Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Tuesday, April 20, 2010

bash shell quick tips

some quick tips on bash shell programming

a) Variable set/access
varname='some text'
echo $varname
b) store command output to a variable
varname=`somecommand`
echo $varname

or,
an alternate way to do it
varname=$(some command)
echo $varname
eg. - to store current timestamp in a variable
current_timestamp=`date +%s`
echo $current_timestamp
c)s
eg
d)
eg
e)
eg
f)
eg
g)
eg

No comments:

Your Ad Here