Re: Issue declaring an array via a variable name

2021-08-22 Thread Alex fxmbsw7 Ratchev
yea i dunno to say, i dont care, peace.. On Sun, Aug 22, 2021, 22:48 Lawrence Velázquez wrote: > On Sun, Aug 22, 2021, at 4:38 PM, Alex fxmbsw7 Ratchev wrote: > > last time again > > You promise? > > > one pair quotes, not more > > Except you're wrong. > > $ val=foo > $ declare "$val"='x' > $

Re: Issue declaring an array via a variable name

2021-08-22 Thread Lawrence Velázquez
On Sun, Aug 22, 2021, at 4:38 PM, Alex fxmbsw7 Ratchev wrote: > last time again You promise? > one pair quotes, not more Except you're wrong. $ val=foo $ declare "$val"='x' $ declare -p "$val" declare -- foo="x" $ val=bar $ declare -a "$val"='(baz quux)' $ declare -p "$val" declare -a

Re: Issue declaring an array via a variable name

2021-08-22 Thread Alex fxmbsw7 Ratchev
as i said how to make it work, last time again, one pair quotes, not more On Sun, Aug 22, 2021, 22:37 Chet Ramey wrote: > On 8/21/21 6:02 PM, Hunter Wittenborn wrote: > >> As an end user I would expect the unquoted `(' > > > >> operator to cause a syntax error, just as it does in `echo ('. > >

Re: Issue declaring an array via a variable name

2021-08-22 Thread Chet Ramey
On 8/21/21 6:02 PM, Hunter Wittenborn wrote: As an end user I would expect the unquoted `(' operator to cause a syntax error, just as it does in `echo ('. Well I'm expecting '(' to be part of the shell's syntax (when unquoted; so likewise not cause a syntax error), but when looking at

Re: Issue declaring an array via a variable name

2021-08-22 Thread Oğuz
22 Ağustos 2021 Pazar tarihinde Hunter Wittenborn < hun...@hunterwittenborn.com> yazdı: > > Well I'm expecting '(' to be part of the shell's syntax (when unquoted; so > likewise not cause a syntax error), but when looking at things like the > left side of a variable assignment, I'm sure you'll

Re: Issue declaring an array via a variable name

2021-08-21 Thread Lawrence Velázquez
On Sat, Aug 21, 2021, at 6:02 PM, Hunter Wittenborn wrote: > In my head, something like this (where 'value' is equal to 'y'): > > `declare "${value}"="x"` > > becomes this (which it appears to do so): > > `declare "y"="x"` Almost. The argument parses without issue ('=' has no special meaning

Re: Issue declaring an array via a variable name

2021-08-21 Thread Alex fxmbsw7 Ratchev
i wrote, i write again declare "var=value" not declare "var"="value" On Sun, Aug 22, 2021, 00:02 Hunter Wittenborn wrote: > > As an end user I would expect the unquoted `(' > > > operator to cause a syntax error, just as it does in `echo ('. > > > > Well I'm expecting '(' to be part of the

Re: Issue declaring an array via a variable name

2021-08-21 Thread Hunter Wittenborn
> As an end user I would expect the unquoted `(' > operator to cause a syntax error, just as it does in `echo ('. Well I'm expecting '(' to be part of the shell's syntax (when unquoted; so likewise not cause a syntax error), but when looking at things like the left side of a variable

Re: Issue declaring an array via a variable name

2021-08-19 Thread Oğuz
20 Ağustos 2021 Cuma tarihinde Hunter Wittenborn < hun...@hunterwittenborn.com> yazdı: > > So, in my opinion, this should logically work (from the view of an end > user): > > > > declare "var"=("i" "j") > `"var"=("i" "j")' doesn't qualify as an assignment statement as the variable name is quoted.

Re: Issue declaring an array via a variable name

2021-08-19 Thread Hunter Wittenborn
The general consensus seems to be that this isn't really a bug (from what I've understood), but it looks like I can use a variable reference to solve the issue nevertheless. Regardless, I'm still wanting to almost classify this as a bug (or possibly a feature request; it feels like it's

Re: Issue declaring an array via a variable name

2021-08-16 Thread Chet Ramey
On 8/14/21 8:45 PM, Hunter Wittenborn wrote: > Hi, > > > > I was doing some testing for some additions to a rather big Bash script I'm > working on, and the following code kept failing whenever I attempted to run > it: > > > > " > > variable="hello" > > > > declare -g

Re: Issue declaring an array via a variable name

2021-08-15 Thread Léa Gris
Le 15/08/2021 à 02:45, Hunter Wittenborn écrivait : - declare -g "${variable}"=("world" "me") - declare -g ${variable}=("world" "me") - declare -g "hello"=("world" "me") Invalid because the string "${variable}" cannot be assigned = the scalar ("world" "me") If you want to dynamically

Issue declaring an array via a variable name

2021-08-14 Thread Hunter Wittenborn
Hi, I was doing some testing for some additions to a rather big Bash script I'm working on, and the following code kept failing whenever I attempted to run it: " variable="hello" declare -g "${variable}"=("world" "me") " When run, it's complaining about a syntax error near "(",