Fozzeebear
Technical User
I am trying (and unfortunately failing!) to write a short Unix script to do the following:
1) do a fgrep search for required strings within a file
2) if there are matches, do nothing
3) if there are no matches, print an error message
The sort of thing I have been trying is:
if test 'fgrep -f list filename' = 0 ;
then echo "error";
fi
But, this does not work. Any help (or suggestions for a simpler approach) will be much appreciated...
1) do a fgrep search for required strings within a file
2) if there are matches, do nothing
3) if there are no matches, print an error message
The sort of thing I have been trying is:
if test 'fgrep -f list filename' = 0 ;
then echo "error";
fi
But, this does not work. Any help (or suggestions for a simpler approach) will be much appreciated...