The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: date search
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 09-23-2007
thirumaran thirumaran is offline
Registered User
 

Join Date: Sep 2007
Posts: 3
Madhan,

Thanks for ur help

awk -v var=`cat date_file` '{ if ( $0 ~ var ) { print } }' log_file

this will get the date and search for the pattern in log file .

can u help me in this
1) search for pattern 1 in log file ( ur awk cmd will work) if it exists then
2) then search for pattren2 from the last occurance of pattern1
3) if pattern2 exists
echo "pattern2 has happened after | date_file value "
fi

Regards
Thiru
Reply With Quote