title: Prevent email from being sent if nawk returns null
body: <p>I was able to get my script to successfully email me at regular intervals with the help of another user here. My next question, is that I'd like for it to ONLY email me if the output is not null.</p>
  
  <p>I have a nawk set up to email me the output, and the script is set up to run every 5 minutes via crontab. Due to the number of log files, this would mean that I'd receive 9 emails every 5 minutes which would blow up my inbox. </p>
  
  <p>Current script:</p>
  
  <pre><code>nawk '$0~s{for(c=NR-b;c&lt;=NR+a;c++)r[c]=1}{q[NR]=$0}END{for(c=1;c&lt;=NR;c++)if(r[c])print q[c]}' b=4 a=4 s="Bind value for HASCHILDREN = 0" filename | mail -s "Output from crontask" myemail
  </code></pre>
  
  <p>Current crontab:</p>
  
  <pre><code>0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/me/crontask
  </code></pre>