[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.
Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/08
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/09
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/09
- Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/09
- Re: declare a="$b" if $a previously set as array,
Greg Wooledge <=
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/09
- Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/09
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/10
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/10
- Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/10
- Re: declare a="$b" if $a previously set as array, Chet Ramey, 2014/12/14
- Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/14
Re: declare a="$b" if $a previously set as array, Chet Ramey, 2014/12/14
Re: declare a="$b" if $a previously set as array, Dan Douglas, 2014/12/15
Re: declare a="$b" if $a previously set as array, Chet Ramey, 2014/12/14