[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: declare a="$b" if $a previously set as array
From: |
konsolebox |
Subject: |
Re: declare a="$b" if $a previously set as array |
Date: |
Wed, 17 Dec 2014 16:44:21 +0800 |
On Mon, Dec 15, 2014 at 1:48 PM, konsolebox <konsolebox@gmail.com> wrote:
> Last thing is `declare -x "$a_complete_assignment"` should not be allowed;
> even quoted assignments like `declare -x "$one=$two"` simply because
> they are already a reinterpreted form i.e. they are already evaluated
> with a pair of single or double-quotes before declare tries to evaluate
> them and it is were declare's behavior becomes inconsistent and it is
> were everything starts going wrong. If we do allow it, how would we
> apply the proper rules to the expanded form of "$any"? - knowing that
> "$any" is already a terrible combination of raw constructs and values
> were literal values meant to be literal values become subject to
> misinterpretation as forms of assignment to an array. And what if
> `$a_complete_assignment` contain `x=$something`, would we expand
> $something or not? This just makes implementation of declare way more
> complicated, difficult and unclear.
Sorry about this. I realized that we could actually allow this but only
in scalar form and with no other form of expansion. So $something would
remain as '$something'. In an expanded argument to declare, any character
that follows the first equal sign in it would be assigned to the
variable (or the first index of the array variable) as is.
konsolebox
- Re: declare a="$b" if $a previously set as array, (continued)
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/08
- Re: declare a="$b" if $a previously set as array, Linda Walsh, 2014/12/08
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/08
- Re: declare a="$b" if $a previously set as array, Eduardo A . Bustamante López, 2014/12/08
- Re: declare a="$b" if $a previously set as array, Linda Walsh, 2014/12/08
- Re: declare a="$b" if $a previously set as array, konsolebox, 2014/12/09
- 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/15
- Re: declare a="$b" if $a previously set as array,
konsolebox <=
- 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, Chet Ramey, 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, Chet Ramey, 2014/12/14
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/14
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/14
- Re: declare a="$b" if $a previously set as array, Chet Ramey, 2014/12/15
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/16
- Re: declare a="$b" if $a previously set as array, Stephane Chazelas, 2014/12/16
- Re: declare a="$b" if $a previously set as array, Chet Ramey, 2014/12/23