Did you test that code before you posted it?
Code:
# TODAY-DATE=`date +"%b %d"`
-su: TODAY-DATE=Sep: command not found
# echo $TODAY-DATE
-DATE
I believe you'll find that '-' is not a legal character in shell variables, although '_' is.
Furthermore, on my MEPIS 6.0 system:
Code:
# date +"%b %d"
Sep 01
while:
Code:
# less -S /var/log/messages |tail -1
Sep 1 08:34:40 localhost -- MARK --
This discrepancy in date format means that your date
grep will not work for me as written. I am curious what your (unnamed) distro & OP's RHEL show.