On Sat, Oct 18, 2025 at 6:27 AM Zachary Santer <[email protected]> wrote:
>
> $ nameref=( 100 101 102 )
> bash: `array[1]': not a valid identifier
> # This error message doesn't make a lot of sense.
> $ array[1]=( 100 101 102 )
> bash: array[1]: cannot assign list to array member
> # This error message would've been better for that.

Similarly:

$ declare -p array
declare -a array=([0]="four" [1]="five" [2]="six" [3]="seven")
$ declare -n nameref='array[1]'
$ nameref[2]=another
bash: `array[1]': not a valid identifier
$ array[1][2]=another
bash: no match: array[1][2]=another

Really don't know what to make of that last error message.

Reply via email to