On 11/12/18 6:55 PM, Grisha Levit wrote:
> The following crashes bash:
>
> bash-5.0$ set -u
> bash-5.0$ echo ${!,}
> bash: $!: unbound variable
> bash: !: unbound variable
How does it `crash bash'? There's an extra error message, but it correctly
notes that $! is not set. If the shell is not inte
> How does it `crash bash'?
Sorry, should have specified. I get the following backtrace (but only
after doing the second expansion).
$ env -i $BASH --norc -iuc $'echo ${!,} \n echo ${!,}'; echo $?
bash: $!: unbound variable
bash: !: unbound variable
bash: $!: unbound variable
139
* thread #1, q
The following crashes bash:
bash-5.0$ set -u
bash-5.0$ echo ${!,}
bash: $!: unbound variable
bash: !: unbound variable
bash-5.0$ echo ${!,}
bash: $!: unbound variable
Testing if $! is set also doesn't seem to be possible:
bash-5.0$ echo ${!-}
bash: $!: unbound variable