The UNIX and Linux Forums  

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




Thread: grep help
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-06-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Add set statement and quotes around the pattern variable.
Code:
set -vx
echo "Please enter the pattern below:"
read pattern
echo -e "Scanning t1 Logs...\n"
grep -i "$pattern" /f1/log/t1.log*
....
Execute your script with sample pattern and show us the trace of your script