Created
October 26, 2012 21:32
-
-
Save Nitrodist/3961690 to your computer and use it in GitHub Desktop.
This file contains 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 | |
line_count=0 | |
text_to_send="" | |
number_of_lines_to_send_at_a_time=5 | |
logfile="irclogs/freenode/#skullspace.log" | |
mailing_to="discuss@lists.skullspace.ca" | |
tail -f -n 0 $logfile | \ | |
while read line | |
do | |
text_to_send="$text_to_send\n$line" | |
line_count=$((line_count+1)) | |
if [[ $line_count -eq $number_of_lines_to_send_at_a_time ]] | |
then | |
echo "Sending mail to $mailing_to after $number_of_lines_to_send_at_a_time lines typed" | |
echo -e $text_to_send | mail -s "SkullSpace IRC Discuss Pipe! $(date)" $mailing_to | |
text_to_send="" | |
line_count=0 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment