bug-bash
[Top][All Lists]
Advanced

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

Re: declare a="$b" if $a previously set as array


From: Greg Wooledge
Subject: Re: declare a="$b" if $a previously set as array
Date: Tue, 9 Dec 2014 08:06:22 -0500
User-agent: Mutt/1.4.2.3i

On Tue, Dec 09, 2014 at 08:55:02PM +0800, konsolebox wrote:
> > declare -g "$var=$something"
> 
> It actually should be completely avoided.  eval is the right tool for
> that job (besides a variable declared with -n in 4.3+).

Unfortunately, "declare -n" is the same as eval.  We've had this
discussion before, and I haven't changed my stance.  At least with
"eval", you know what you're getting.  "declare -n" looks like something
different, but it's not.  That's where the danger lies.



reply via email to

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