This is my script, I want to find a pattern in a file. I know the exit status of grep -q '<Pattern>' '<file>' && echo $?
is 0 if pattern is found. But I am getting if: Expression Syntax error.
if ( (grep -q '<Pattern>' '<file>' && echo $?)==0 ) then
echo "Pattern found"
else
echo "Pattern not found"
endif