I'm checking to see if a specific string exists on any line in a specific file as shown below:
if grep -Fxq "-a always,exit -F arch=b32 -S chmod -F auid -k perm_mod" /etc/audit/audit.rules; then
echo "text found."
fi
However, I get a message that grep is being passed an invalid option ' ' (a space character). I also tried saving the string to a variable and then using grep on the variable. It modifies the error to say that -S is an invalid option.
I think that somehow my entire string is not being interpreted as input to grep, with part of the string being interpreted as options.