bug-bash
[Top][All Lists]
Advanced

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

Re: Setting a value to an indirectly named variable


From: Paul Jarc
Subject: Re: Setting a value to an indirectly named variable
Date: Thu, 11 Oct 2001 12:00:43 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

jan@gingerall.cz (Jan Janousek) wrote:
> I expected that the third line of the script ($A=xxx) should set the
> value xxx to the variable X (the same way as the fifth line (export -n
> $A=xxx)) but it resulted into the error "./a: X=xxx: command not
> found".

Right.  eval "$A=xxx" will do what you want.  Variable names in
assignment statements are not subject to variable expansion.


paul



reply via email to

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