bug-bash
[Top][All Lists]
Advanced

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

${!vname} not documented


From: Mikel Ward
Subject: ${!vname} not documented
Date: Tue, 06 Oct 2009 14:05:41 +1100

Hi

I came across a script that did

$ VARIABLE1=value1
$ VARIABLE2=value2
$ for VAR in VARIABLE1 VARIABLE2
> do
> echo ${VAR}=${!VAR}
> done
VARIABLE1=value1
VARIABLE2=value2

I was unfamiliar with ${!VAR}.  As far as I can tell, it's not documented in 
the man page or the info pages.

I assume it was imported from Korn Shell
http://www.research.att.com/sw/download/man/man1/ksh.html

        ${!vname }
                Expands to the name of the variable referred to by
                vname. This will be vname  except when vname  is a name
                reference.






reply via email to

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