GaijinPunch
MIS
Greets -- I'm sure this is something incredibly silly and easy, that I'm just not getting. Let's say I've got this:
if grep "nimrod" mylog.log
then
print "there's a nimrod in your log!"
fi
And w/ a log file like
Bob is kewl
Jane is an idiot
You are a nimrod
the out put would be
$>nimrod.ksh
You are a nimrod
there's a nimrod in your log!
I want to get rid of the string that's matched in the log file, and only print out the string in the print statement when a match is found. Easy?
Thanks
if grep "nimrod" mylog.log
then
print "there's a nimrod in your log!"
fi
And w/ a log file like
Bob is kewl
Jane is an idiot
You are a nimrod
the out put would be
$>nimrod.ksh
You are a nimrod
there's a nimrod in your log!
I want to get rid of the string that's matched in the log file, and only print out the string in the print statement when a match is found. Easy?
Thanks