Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep exit problem

Status
Not open for further replies.

municipal

Programmer
Jan 1, 2001
62
0
0
IL
Hi
I have a script that have the next command
grep -E "successfull" `find ./monitor.log* -ctime -1`
when there is no file found in the find command
the grep command is not finish
How can i fnish it?
TIA..
municipal
 

for i in `find ./monitor.log* -ctime -1`; do grep -E "successfull" $i;done
 
or maybe better:


for i in `find ./ -name "monitor.log"* -ctime -1`;do grep -E "successfull" $i;done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top