I saw this wonderful script in a previous post and modified it to work, my question is
is there a way to enable a prompt at the GREP portion to allow me to enter what I wish to grep before hand?
#!/bin/sh
DATE=`date +%Y%m%d%H%M%S`
HOME=/u/home/xxx/report
LOG_DIR=/var/log/
CONSOLE_FILE=ncolog
ALERTS_FILE=report
CONSOLE_OUTPUT=/u/home/xxx/console
ALERTS_OUTPUT=/u/home/xxx/alerts
cd $LOG_DIR
tail -f $CONSOLE_FILE > $CONSOLE_OUTPUT &
grep -i "PROMPT!" $CONSOLE_FILE > $CONSOLE_OUTPUT
a=`ls -lrth $CONSOLE_OUTPUT |awk '{print$5}'`
if [ $a -eq 0 ];
then
echo "The file is empty"
else
echo "The Vaule of A differs, please check"
#/usr/bin/printf "***** NVC ALERT - $DATE *****\n\nHost: `hostname` \n\nDATE: `date` \n\n" | /bin/mailx -s "Error $DATE " amil@ex
fi
exit 0