bug-bash
[Top][All Lists]
Advanced

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

Re: setting array values


From: Paul Jarc
Subject: Re: setting array values
Date: Mon, 03 Dec 2001 22:26:14 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

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")

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

> 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

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


paul



reply via email to

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