Sujet : What does @{FOOBAR@a} mean? (bash)
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.shellDate : 13. Apr 2024, 21:35:27
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <uveqaf$3obat$1@news.xmission.com>
User-Agent : trn 4.0-test77 (Sep 1, 2010)
Observe:
$ unset FOOBAR
$ echo ${
FOOBAR@a}
$ FOOBAR=
$ echo ${
FOOBAR@a}
$ export FOOBAR
$ echo ${
FOOBAR@a}
x
$
It seems that it prints "x" iff the variable has been exported.
This works with any variable - the output is always "x" (iff it is exported).
I can find no mention of this feature in "man bash". Note: I am not saying
it isn't in there - just that I couldn't find it.
Note that any other letter (such as "b") generates an error message if
FOOBAR is non-empty:
$ echo ${
FOOBAR@b}
$ FOOBAR=Test
$ echo ${
FOOBAR@b}
bash: ${
FOOBAR@b}: bad substitution
$
What is going on?
-- No, I haven't, that's why I'm asking questions. If you won't help me,
why don't you just go find your lost manhood elsewhere.
CLC in a nutshell.