Sponsored Content
Full Discussion: Unexpected Echo Behavior
Top Forums Shell Programming and Scripting Unexpected Echo Behavior Post 302738295 by sjrupp on Friday 30th of November 2012 07:35:34 PM
Old 11-30-2012
Unexpected Echo Behavior

Hello all,

I have a basic issue that I can't seem to search for since I'm not sure how to describe the behavior. Could anyone kindly assist the novice?

(Sample) File Data:
Code:
bundle-ppp-1/1.78
bundle-ppp-1/2.80
bundle-ppp-1/1.79
bundle-ppp-1/2.81
bundle-ppp-1/1.80
bundle-ppp-1/2.82
bundle-ppp-1/1.81
bundle-ppp-1/2.83
bundle-ppp-1/1.82
bundle-ppp-1/2.84

Code:
Code:
# for all in `cat output`; do echo "/configure port $all shutdown"; done

Expected output:
Code:
/configure port bundle-ppp-1/1.78 shutdown

Actual output:
Code:
shutdowne port bundle-ppp-1/1.78

I see that it has taken the "shutdown" portion of the echo command and overwritten the word "configure" but I don't understand why or how to correct the behavior.

Thanks for taking the time to read my post Smilie

Last edited by Franklin52; 12-02-2012 at 08:45 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Programming

ls behavior

I put this here because it is a 'behavior' type question.. I seem to remember doing ls .* and getting all the .-files, like .profile .login etc. But ls .* doesn't do that, it lsts the contents of every .*-type subdirectory. Is it supposed to? I should think that a -R should be given to... (10 Replies)
Discussion started by: AtleRamsli
10 Replies

2. Shell Programming and Scripting

Echo behavior

Echo is removing extra blank spaces. See the command. export INSTALLDIR=”First Second /Two Space” echo $INSTALLDIR out put: First Second /Two Space Here only on blnak space is present while with command Echo “$INSTALLDIR” Out put: ”First Second /Two Space” It's correct output... (2 Replies)
Discussion started by: Saurabh78
2 Replies

3. Solaris

Unexpected df behavior

Hi, I have Sun SPARC Enterprise T5140 with two 2,5" 15rpm 146GB SAS HDD. In friday there were a lot of errors with fs on them. After reconfiguring all seemed to be fine but today I get the following strange behavior of df -kh command and troubles with files, I written on first disk in friday.... (9 Replies)
Discussion started by: Sapfeer
9 Replies

4. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

5. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

6. HP-UX

Unusual Behavior?

Our comp-operator has come across a peculiar ‘feature'. We have this directory where we save all the reports that were generated for a particular department for only one calendar year. Currently there are 45,869 files. When the operator tried to backup that drive it started to print a flie-listing... (3 Replies)
Discussion started by: vslewis
3 Replies

7. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

8. IP Networking

iptables DNAT of outgoing destination port, unexpected behavior

Not sure if this should be here or in the security section. I am developing software that dynamically manipulates netfilter/iptables rules (through system() calls of the command strings, I'm not trying to hack the netfilter code). Basically, UDP messages that are sent by an application on, say,... (0 Replies)
Discussion started by: cjh19460
0 Replies

9. UNIX for Advanced & Expert Users

unexpected behavior bash, set -o vi, history -a, and HISTFILE

I am trying to get my history in sync in multiple bash sections and things aren't working the way I expect. Desired behavior, hitting esc-K in all bash sessions (same userid and machine) will use the same history. Observed behavior: Esc-k shows the history of the current session, rather than... (8 Replies)
Discussion started by: gg48gg
8 Replies

10. UNIX for Dummies Questions & Answers

Launchd-owned processes unexpected behavior

Ok, so I have been struggling with this for a few days and I think I need an explanation of a few things before I go any further. I'm not sure it's possible to do what I'm trying, so before I pull my hair out, here is what I'm doing: I have written a program in LiveCode that sits on our... (2 Replies)
Discussion started by: nextyoyoma
2 Replies
APTITUDE-CREATE()														 APTITUDE-CREATE()

NAME
aptitude-create-state-bundle - bundle the current aptitude state SYNOPSIS
aptitude-create-state-bundle [<options>...] <output-file> DESCRIPTION
aptitude-create-state-bundle produces a compressed archive storing the files that are required to replicate the current package archive state. The following files and directories are included in the bundle: o $HOME/.aptitude o /var/lib/aptitude o /var/lib/apt o /var/cache/apt/*.bin o /etc/apt o /var/lib/dpkg/status The output of this program can be used as an argument to aptitude-run-state-bundle(1). OPTIONS
--force-bzip2 Override the autodetection of which compression algorithm to use. By default, aptitude-create-state-bundle uses bzip2(1) if it is available, and gzip(1) otherwise. Passing this option forces the use of bzip2 even if it doesn't appear to be available. --force-gzip Override the autodetection of which compression algorithm to use. By default, aptitude-create-state-bundle uses bzip2(1) if it is available, and gzip(1) otherwise. Passing this option forces the use of gzip even if bzip2 is available. --help Print a brief usage message, then exit. --print-inputs Instead of creating a bundle, display a list of the files and directories that the program would include if it generated a bundle. FILE FORMAT
The bundle file is simply a tar(1) file compressed with bzip2(1) or gzip(1), with each of the input directory trees rooted at ".". SEE ALSO
aptitude-run-state-bundle(1), aptitude(8), apt(8) AUTHOR
Daniel Burrows <dburrows@debian.org> Author. COPYRIGHT
Copyright 2007 Daniel Burrows. This manual page is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This manual page is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. APTITUDE-CREATE()
All times are GMT -4. The time now is 04:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy