Monday, August 27, 2007

Content of content of a variable !


Digest for today morning: use of ${!VARIABLE} , learnt from Navojit Dutta(UNIX forum)

$ cat content
MYVAR=$1
DUMMY1="This is tricky"
DUMMY2=24
echo ${!MYVAR}


$ ./content DUMMY1
This is tricky

$ ./content DUMMY2
24

No comments:

© Jadu Saikia www.UNIXCL.com