|
I don't think I have that. How to check ?
I can extract the date , let say 24. But how to do -1
How to correct below code's syntax in /bin/sh
myDate= `date -u +%d`
myMonth=`date -u +%m`
myYear=`date -u +%Y`
myAnotherMonth=`date -u +%b`
if [ $myDate == 1 && ( $myAnotherMonth == Sep || $myAnotherMonth == Apr || $myAnotherMonth == Jun || $myAnotherMonth == Nov || $myAnotherMonth == Feb ) ]
then
yesterday = 30
elseif [ $myDate == 1 && $myAnotherMonth == Feb]
yesterday=28 # I dont worry about month end with 29
else
yesterday = $myDate - 1
fi
cat /var/adm/sulog | grep "$myMonth\/$yesterday" | grep -v grep > $myYear$myMonth$yesterday_sulog.txt
Last edited by skully; 06-24-2008 at 04:28 AM..
|