I found this line:
sh script.sh | grep 'NO' 2>&1 > grep.log && /usr/bin/mail -s "grep found something" m@mail.com < grep.log
which will write the output of script.sh to grep.log and then email that to an email m@mail.com
Is there anyway to remove the part where this wrote to grep.log and simply mail the output of the script without having to write it to a file?