I want to download the source of a web page and then check for the presence of one string, and the absence of another. I have working code below - is it possible to do this entire script as a one-line command?
PAGE_SOURCE=`curl https://example.com`
if ! echo "$PAGE_SOURCE" | grep -q "string that is bad"; then
if echo "$PAGE_SOURCE" | grep -q "string that is good"; then
exit 0
fi
fi
exit 1