bug-bash
[Top][All Lists]
Advanced

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

@Q breaks set -o nounset


From: Martin Schulte
Subject: @Q breaks set -o nounset
Date: Sun, 3 Mar 2019 17:53:23 +0100

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



reply via email to

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