Wednesday, 14 August 2013

How to Print or Access Value of UDV (User Defined Variables)

To print or access UDV use following syntax
Syntax: $variablename
For eg. To print contains of variable ‘test’
$ echo $test
It will print ‘Bus’ (if previously defined as test=Bus) ,To print contains of variable ‘n’ $ echo $n
It will print ‘10′ (if previously defined as n=10)
Caution: Do not try $ echo test It will print test instead its value ‘Bus’ and $ echo n, It will print
n instead its value ‘10′, You must use $ followed by variable name.

No comments:

Post a Comment