Bert
1
I'm looking to pull the last 24 hours of a log file.
Here's what I've got so far:
yesterday=$(TZ=$TZ+24 date +"%b %e %H:%M")
today=$(date +"%b %e %H:%M")
echo $yesterday $today
grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log
But that pulls everything from $yesterday from 12:01am instead of 24 hrs prior to the current date and time.
Thoughts?
Thanks...
Try this :
sed -n "/^${yesterday}/,/^${today}/ p" /var/adm/syslog/syslog.log