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 Hunter Wittenborn
d array assignment statements as arguments, and > > the parser accommodates this as long as two conditions hold: the parser can > > detect that the first word of a simple command is `declare' and the > > argument is a valid assignment statement. In this case, the second fails, > > since `"${variable}"' is not a valid shell identifier. That renders the > > argument not a valid assignment statement. --- Hunter Wittenborn https://www.hunterwittenborn.com https://github.com/hwittenborn

Issue declaring an array via a variable name

2021-08-14 Thread Hunter Wittenborn
Lastly: A workaround for this was found here [1] which uses namerefs, and works just fine (and is probably easier for me to look at anyway), but this seemed like something that deemed a bug report regardless. [1]: https://lists.gnu.org/archive/html/help-bash/2021-08/msg00069.html --- Hunter Wittenborn https://www.hunterwittenborn.com https://github.com/hwittenborn