Sujet : Re: What does @{FOOBAR@a} mean? (bash)
De : jpstewart (at) *nospam* personalprojects.net (John-Paul Stewart)
Groupes : comp.unix.shellDate : 13. Apr 2024, 21:54:42
Autres entêtes
Message-ID : <l809oiF532iU1@mid.individual.net>
References : 1
User-Agent : Mozilla Thunderbird
On 2024-04-13 4:35 p.m., Kenny McCormack wrote:
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.
Search the man page for 'Parameter transformation' and you'll find it.
It's the last entry in the 'Parameter Expansion' section, just before
'Command Substitution' if that makes it any easier to find.