Mail only files with contents
RHEL El 5
Am using the below script to send mails as an sql output . but the below script sends the generated file even if it is empty (if there is no outputs generated from the sql command) .
I want to send mail only if the file has some valid outputs. How to do this
cat <filename.ext> | mail -s "ALERTMEDDB$DATE_SUFFIX" <mailid>
mailx -s "ALERTMEDDB$DATE_SUFFIX" mailid < $tmpdir/ALERTMEDDB$DATE_SUFFIX.log &
Last edited by kais1; 06-29-2011 at 03:04 AM.