bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comments in arrays, it's like Wayne's World


From: Dan Jacobson
Subject: comments in arrays, it's like Wayne's World
Date: 28 Nov 2001 22:27:09 +0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

gee, i put a little comment into my array, and
$ mmm=(a
> b
> #c
> d
> )
$ echo ${mmm[*]}
a b ls --color=auto -F
I think it went munching into the aliases or something.
OK, that was interactive, but in a script it's ok:

$ cat bbb
a=(r
s
#t
v
)
echo ${a[*]}

m=("fff"
# "fffffff"
"eee"
)
echo ${m[@]}

letters=("0" "1" "A B C" "D E F" "G H I " "J K L" "M N O"
#     "P R S" "T U V" "W X Y")
      "P Q R S" "T U V" "W X Y Z")

$ bash bbb
r s v
fff eee
bbb: line 16: syntax error near unexpected token `Z")'
bbb: line 16: `      "P Q R S" "T U V" "W X Y Z")'
$ sed 's/Y")/Y"/' bbb|bash
r s v
fff eee

well gosh, I thought nothing much could see thru a mighty "#" :-(

GNU bash, version 2.05.0(1)-release (i586-pc-linux-gnu)
-- 
http://www.geocities.com/jidanni/ Tel+886-4-25854780



reply via email to

[Prev in Thread] Current Thread [Next in Thread]