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