Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable not formatting correctly

Status
Not open for further replies.

cmackowski

IS-IT--Management
Jun 23, 2000
20
US
I need to make a variable to the previous day to grep items from /var/adm/messages. The command works fine from prompt. Once you turn it into variable, the formatting is wrong.


bash-2.05$ /usr/bin/perl -e 'print substr(localtime(time-86400), 4, 6),"\n";'
Dec 9 <<<Correct, with two spaces between Dec and 9<<<
bash-2.05$ YESTERDAY=`/usr/bin/perl -e 'print substr(localtime(time-86400), 4, 6),"\n";'`
bash-2.05$ echo $YESTERDAY
Dec 9 <<<incorrect<<<


Any Ideas??
-Chris

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top