hy i have a requirement in which my script needs to find 3 patterns in a file and if any pattern is missing it should sent a mail
Patterns
Interval60min_Daily_readings$a.txt
Interval_Daily_readings$a.txt
Daily_readings$a.txt
Basically i want to test for the above Patterns in the file generated by the script .How shall i implement this logic in my script
Below my script
#!/bin/ksh
rm -rf all_rep_files.txt
TZ=`date +%Z`+24 ;a=`date +"%m%d%Y"`
echo $a
for i in 616498114_ReliantES 799530915_ReliantRS
do
echo "user odad odd" > ftp.txt
echo "prompt" >> ftp.txt
echo "cd $i" >> ftp.txt
echo "ls -ltr" >> ftp.txt
echo "bye" >> ftp.txt
ftp -nv ftp.oncor.com < ftp.txt > ftplog_$i.log
echo "Completed for $i"
cat ftplog_$i.log | egrep "Interval_Daily_readings$a|Daily_readings$a|Interval60min_Daily_readings$a" > ftplog_$i.txt
echo "**********************CONTENTS OF REP $i*****************************" >> all_rep_files.txt
cat ftplog_$i.txt >> all_rep_files.txt
rm -rf ftplog_$i.log
########here only i need to test in the file ftplog_$i.txt for those patterns and if not found should mail the pattern#############