title: echo text and tail log to pipe to email
body: <p>I want to echo text as well as tail the last part of a log to pipe it to email. I can easily do one or the other, but how do I do both without first writing everything to a file and then emailing that? I basically want to combine the below two commands into one to only send out one email.</p>
  
  <pre><code>echo "There is an error in the log, see the below for detail" | mail -s "error in the log" xxx@yyy.zzz 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>tail -n 10 /var/log/error.log | mail -s "error in the log" xxx@yyy.zzz
  </code></pre>
  
  <p>Thanks.</p>