bug-bash
[Top][All Lists]
Advanced

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

[3.0.13] declare -a a=('$0')


From: Stephane Chazelas
Subject: [3.0.13] declare -a a=('$0')
Date: Fri, 10 Sep 2004 12:40:34 +0100
User-agent: Mutt/1.5.6i

declare seems to evaluate its arguments:

bash-3.00$ b='$0'
bash-3.00$ echo "$b"
$0
bash-3.00$ declare -a a=("$b")
bash-3.00$ echo "$a"
./bash
bash-3.00$ echo "$BASH_VERSION"
3.00.13(1)-release

bash-3.00$ b=")"
bash-3.00$ declare -a a=("$b")
bash-3.00$ echo "$a"

bash-3.00$

bash-3.00$ b="("
bash-3.00$ declare -a a=("$b")
bash: bad substitution: no closing `)' in (()

See also:
http://groups.google.com/address@hidden

zsh behavior (report a syntax error) is less misleading.

regards,
Stephane

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________




reply via email to

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