Saturday, July 12, 2008

assigning the output of a unix command to a shell variable

Suppose you have to obtain the output of ls command in a variable called var,
then you could do following.

var=`ls`

echo $var

Sphere: Related Content

0 comments: