bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ${var@A} ${var@a} when var is a nameref


From: Zachary Santer
Subject: Re: ${var@A} ${var@a} when var is a nameref
Date: Sat, 18 Oct 2025 20:30:25 -0400

On Sat, Oct 18, 2025 at 6:27 AM Zachary Santer <zsanter@gmail.com> 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

[Prev in Thread] Current Thread [Next in Thread]