title: Formatting a bash cat pipe to mail command
body: <p>When I wrote this script it works just fine.  What it does is it diffs two file
  and if the diff fails that indicates that their is no change between the todays file
  and the previous days file. That menas the the download is stale.
  However when I to email it it is not formatted. I treid putting in a newline
  so that the email is legible. But the mail function does not work.  The file is
  to garbled to read.</p>
  
  <pre><code>#!/bin/bash
  dayofweek=$(/bin/date +%w)
  today=$(/bin/date +%Y.%m.%d_)
  yesterday=$(/bin/date -d '1 day ago' +%Y.%m.%d_)
  destination="/sbclocal/stmevt3/dailymetrics/EQ_PERFORMANCE/"
  
  file1=OPTS_TRIP_TRIP_csv_Oct2014.csv
  file2=OPTS_TRIPnon-penny1-20_TRIPnon-penny1-20_Oct2014.csv
  file3=OPTS_TRIPnon-penny21-50_TRIPnon-penny21-50_Oct2014.csv
  file4=OPTS_TRIPnon-penny51-100_TRIPnon-penny51-100_Oct2014.csv
  file5=OPTS_TRIPpenny1-20_TRIPpenny1-20_Oct2014.csv
  file6=OPTS_TRIPpenny21-50_TRIPpenny21-50_Oct2014.csv
  file7=OPTS_TRIPpenny51-100_TRIPpenny51-100_Oct2014.csv
  
  
  for i in $file1 $file2 $file3 $file4 $file5 $file6 $file7
  do
  if diff $destination$today$i $destination$yesterday$i &gt; /dev/null ; then
      printf "$today$i may be stale - please notify production\n" &gt;&gt; /tmp/eq_diffs.$today
  sleep 2
  else
  echo " " &gt; /dev/null
  fi
  done
  
  #think we might have to do a if file exists
  cat /tmp/eq_diffs.$today | mail -s "EQ performance diffs" casper@casper.com
  </code></pre>