[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue declaring an array via a variable name
From: |
Hunter Wittenborn |
Subject: |
Re: Issue declaring an array via a variable name |
Date: |
Sat, 21 Aug 2021 17:02:12 -0500 |
User-agent: |
Zoho Mail |
> 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 assignment, I'm sure you'll agree that it should allow any
string that fits a variable's normal specification (regardless of being an
array or not).
Maybe this will explain how I'm thinking about it:
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"`
Logically (for me anyway), this:
`declare "${value}"=("x" "z")`
should then become this:
`declare "y"=("x" "z")`
- Issue declaring an array via a variable name, Hunter Wittenborn, 2021/08/14
- Re: Issue declaring an array via a variable name, Hunter Wittenborn, 2021/08/19
- Re: Issue declaring an array via a variable name, Oğuz, 2021/08/20
- Re: Issue declaring an array via a variable name,
Hunter Wittenborn <=
- Re: Issue declaring an array via a variable name, Alex fxmbsw7 Ratchev, 2021/08/21
- Re: Issue declaring an array via a variable name, Lawrence Velázquez, 2021/08/21
- Re: Issue declaring an array via a variable name, Oğuz, 2021/08/22
- Re: Issue declaring an array via a variable name, Chet Ramey, 2021/08/22
- Re: Issue declaring an array via a variable name, Alex fxmbsw7 Ratchev, 2021/08/22
- Re: Issue declaring an array via a variable name, Lawrence Velázquez, 2021/08/22
- Re: Issue declaring an array via a variable name, Alex fxmbsw7 Ratchev, 2021/08/22