Hello,
with "GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)" I get
the following behaviour:
+ bash -c 'set -o nounset; echo $x'
bash: x: unbound variable
+ bash -c 'set -o nounset; echo ${x}'
bash: x: unbound variable
+ bash -c 'set -o nounset; echo ${x@Q}'
+ bash -c 'set -o nounset; echo ${x/a/b}'
bash: x: unbound variable
"GNU bash, version 5.0.0(1)-release (x86_64-pc-linux-gnu)" behaves
identically.
So, @Q breaks the 'set -o nounset'.
Is this intended?
I like using @Q for output of variables with unknown content - is there a
better way to do this?
Best regards,
Martin