I want my shell can only find out the pattern in the quote,
but the result also returned something like "MSGxxxxx"
Anybody who can give me some advise?
Here is my script:
if egrep -e 'Msg|duplicate|deadlock|status = -|terminated due to disconnect' MYFILE.log
then
echo "I found something in your RAW data."
else
echo "Nothing found!"
fi
Use the
-wflag in order to select only those lines containing matches that form whole words.Alternatively, use a word boundary
\bas shown below: