I want to check if file exists and then check for a substring in the file
if [ -f /etc/abc.conf ]; then
if [ grep 'abc.conf' -e 'host.com' ]
test = 'PASS'
else
test = 'FAIL'
fi
else
echo "File doesnot exist"
fi
echo $test
Please let me know if there is a better way to do the same