Quote:
Originally Posted by shalua
Just want to make my question more clear. I want to check if all 3 lines exist or not, meaning an AND condition.
Thanks!!
|
Give this a try:
Code:
#!/bin/sh
#set -x
filename="your_file"
lineA="ALL MATCHING RECORD COLUMNS MATCHED (Baseline and Regression File)"
lineB="Total Mismatched Records (Baseline File): 0"
lineC="Total Mismatched Records (Regression File): 0"
if grep "$lineA" "$filename" && grep "$lineB" "$filename" && grep "$lineC" "$filename"
then
echo "Match" >> reg_email_body
else
echo "There is a mismatch" >> reg_email_body
fi