Created
January 2, 2014 16:08
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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