I'm currently writing a bash script that should check if the exact string 329,
exists in myfile
. I have searched through the web and found some answers, but I can't use -x
parameters because I have more numbers than 329,
on myfile
. And without the -x
parameter, I can get the Exists
result with 329
too, which I don't want.
I tried;
if grep -xqFe "329," "myfile"; then
echo -e "Exists"
else
echo -e "Not Exists"
fi
And the output was;
Not Exists
Inside of myfile
;
329, 2, 57
How can I solve this?