Skip to content

Instantly share code, notes, and snippets.

@caseyamcl
Created January 2, 2014 16:08
Show Gist options
  • Save caseyamcl/8221497 to your computer and use it in GitHub Desktop.
Save caseyamcl/8221497 to your computer and use it in GitHub Desktop.
Fakemail - A simple BASH script for piping mail to a /tmp/fakemail/DATE
#!/bin/bash
#Make the output directory if not exists
if [ ! -d /tmp/fakemail ];
then
mkdir -p /tmp/fakemail
fi
#Create today's fakemail file
OUTPUTFILE=/tmp/fakemail/`date +'%F'`.txt
echo -e "\n\n" >> $OUTPUTFILE
echo -e "---------------------------------------------------------------" >> $OUTPUTFILE
echo -e "\n\n" >> $OUTPUTFILE
while read line
do
echo "$line" >> $OUTPUTFILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment