Hi All ...
My Script looks like this:
********************************************************
cat sanity.cfg | while read line
do
grep $line bigfile
if [ "$?" -ne "1" ]
then
echo "Cannot find $line"
fi
done;
**********************************************************
And the sanity.cfg file will have many strings in it that look like the one below:
<remote host="1.1.1.1" port="6018"/>
I need to check if these strings exist in a bigger file called bigfile, and if they don't raise a warning. The problem is that grep seems to complain about the special characters, dots and spaces in my string and break it up ... although when I do a "echo $line" I get the correct/whole line back. I tried grep -x & grep -w etc but they don't appear to work, also grep -E. I also tried putting the strings I'm searching for in the cfg file in single quotes .... Any ideas or advice or a possible better way of doing it would be fantastic .. Thanks a lot!
S
My Script looks like this:
********************************************************
cat sanity.cfg | while read line
do
grep $line bigfile
if [ "$?" -ne "1" ]
then
echo "Cannot find $line"
fi
done;
**********************************************************
And the sanity.cfg file will have many strings in it that look like the one below:
<remote host="1.1.1.1" port="6018"/>
I need to check if these strings exist in a bigger file called bigfile, and if they don't raise a warning. The problem is that grep seems to complain about the special characters, dots and spaces in my string and break it up ... although when I do a "echo $line" I get the correct/whole line back. I tried grep -x & grep -w etc but they don't appear to work, also grep -E. I also tried putting the strings I'm searching for in the cfg file in single quotes .... Any ideas or advice or a possible better way of doing it would be fantastic .. Thanks a lot!
S