On Thu, 2005-10-13 at 08:18 -0700, Freddy Freeloader wrote: > Hi all, > > I downloaded the Advanced Bash Scripting Guide the other day an have > started to work my way through it. I'm fairly new to bash so I get more > than a little confused when the output I get is nothing similar to what > the ABS Guide says it should be. > > Here is what has me confused at the moment. > > b=${a/23/BB} > > echo "b = $b" > > Now the ABS guide says that where I'm setting b it should be > substituting BB for 23. It also says that the output of 'echo "b - $b"' > should be: b = BB35 > > However, what I get as output is as follows: > > [EMAIL PROTECTED]:~$ echo "b = $b" > b =
if a is unset then that is correct... > total 520716 > drwxr-sr-x 2 ffreeloader ftp 48 2005-10-13 07:50 script > -rw-r--r-- 1 ffreeloader ftp 532692172 2005-10-12 09:38 server_2003.zip this is a listing of your current directory... > Now in my playing around this morning I've been using some command > substitution from the bash prompt that included cd'ing into a directory > that has the files in it that are listed above. I assume that somehow > setting $b to the value I set it to is calling the history command in > the bash shell and that's how I'm getting this output. However, I don't > know why or how it works. if you have not editted your .bash* files, re-login afresh and try again. the preceeding para implies you may have (inadvertedly) done something to, say, .bashrc so it executes something on certain conditions and this is where the `ls` output is from. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]