The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-23-2008
manik007 manik007 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 1
I need help with a shell script

i am trying to parse the logs from SystemOut.log file and emailing it to my email address ,and i am not able to. Can anyone help me with this....

i tried creating this :
#!/bin/sh
echo " " > /SystemOut.log
for i in 2 3 4 5 6 7 8 9 10
do
shellscript1 -parameter >> /SystemOut.log
sleep 10
done
line=`cat /SystemOut.log | grep 'manik' | wc -l`
echo $line
if [ $line -eq 0 ]
then
echo " "| mail -s "That's the subject" email@email.com
else
cat SystemOut.log | grep 'manik' | mail -s "Did not match the pattern" email@email.com

fi
exit 0



Thank you in advance

edit by bakunin: please post your question to a new thread. Your question and the question of the thread owner have nothing to do with each other.

I am going to split your question to a new thread.

Last edited by bakunin; 09-24-2008 at 07:23 AM..