The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-09-2009
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
If you do this:
var=date

echo $var
echo "$var"
you're just going to get the work "date" displayed. To run the date command and use its output, you need to do:
echo $(date)
echo $($var)
if you're using a modern shell. If you're using an antique shell:
echo `date`
echo `$var`

And next time please tell us which shell you're using.