bug-bash
[Top][All Lists]
Advanced

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

Verifying behavior of nameref feature


From: Jonathan Hankins
Subject: Verifying behavior of nameref feature
Date: Fri, 19 Dec 2014 16:10:35 -0600

I wanted to verify that this behavior is intended, as I can't find it described in the manual. 

$ echo $BASH_VERSION
4.3.30(1)-release
$ foo=bar
$ echo $foo
bar
$ bar=123
$ echo $bar
123
$ typeset -n foo
$ echo $foo
123
$ echo ${!foo}        # this is what I want to verify
bar

Is using ${!foo} intended to yield the name of the var that foo references, now that foo has been turned into a nameref?  I wanted to use this functionality in a script, but wanted to make sure it was intentional before I rely on it.

Thanks,

-Jonathan Hankins


--
------------------------------------------------------------------------
Jonathan Hankins    Homewood City Schools

The simplest thought, like the concept of the number one,
has an elaborate logical underpinning. - Carl Sagan

jhankins@homewood.k12.al.us
------------------------------------------------------------------------


reply via email to

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