Re: declare/typeset can't set array to variable name

2018-01-05 Thread Chet Ramey
On 1/5/18 2:05 PM, Tim Burnham wrote: > > Why does the parser inconsistently detect the identifier `${var2}'? In > the 3rd line of my example, Bash assigns the given expression into > `${var3}' as intended. The parser is consistent. It doesn't mark that word as a valid assignment statement, eith

Re: declare/typeset can't set array to variable name

2018-01-05 Thread Tim Burnham
On Fri, Jan 5, 2018 at 8:02 AM, Chet Ramey wrote: > On 1/4/18 9:27 PM, Tim Burnham wrote: > >> Bash Version: 4.4 >> Patch Level: 12 >> Release Status: release >> >> Description: >> Declare/typeset throws error when trying to create a new array to a >> name held in a variable. >> >> Repeat-By: >> t

Re: declare/typeset can't set array to variable name

2018-01-05 Thread Greg Wooledge
On Fri, Jan 05, 2018 at 08:02:24AM -0500, Chet Ramey wrote: > On 1/4/18 9:27 PM, Tim Burnham wrote: > > tim@TimBookPro:~/ declare ${var2}="And this works" > > tim@TimBookPro:~/ declare ${var2}=( This breaks ) > > -bash: syntax error near unexpected token `(' > It's a syntax error. Pages that may

Re: declare/typeset can't set array to variable name

2018-01-05 Thread Chet Ramey
On 1/4/18 9:27 PM, Tim Burnham wrote: > Bash Version: 4.4 > Patch Level: 12 > Release Status: release > > Description: > Declare/typeset throws error when trying to create a new array to a > name held in a variable. > > Repeat-By: > tim@TimBookPro:~/ declare var1=( This works ) > tim@TimBookPro:

declare/typeset can't set array to variable name

2018-01-05 Thread Tim Burnham
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: darwin17.0.0 Compiler: clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='darwin17.0.0' -DCONF_MACHTYPE='x86_64-apple-darwin17.0.0' -DCONF_VENDOR='apple' -DLOCALEDIR='/usr/local/