bug-bash
[Top][All Lists]
Advanced

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

Re: setting array values


From: Jim Thomas
Subject: Re: setting array values
Date: Mon, 3 Dec 2001 19:11:53 -1000 (HST)

>>>>> "Paul" == Paul Jarc <prj@po.cwru.edu> writes:

 Paul> Jim Thomas <thomas@cfht.hawaii.edu> wrote:
 >> bash-2.05$ declare -a a=($@)
 >> bash-2.05$ echo ${a[$*]}
 >> bash: 1 2 3: syntax error in expression (error token is "2 3")

 Paul> ITYM "echo ${a[*]}".

Duh :-(

 >> bash-2.05$ declare -a $foo=($@)
 >> bash: declare: a: cannot assign to array variables in this way
 >> bash: declare: `2': not a valid identifier
 >> bash: declare: `3)': not a valid identifier

 Paul> Maybe this works: eval "declare -a $foo=($@)"

Yes, thank you.  But shouldn't the original work too?

Mahalo,
Jim



reply via email to

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