Eugene Smiley on 6 Nov 2007 22:34:21 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Auto-send Email


JP Vossen wrote:
From: Eugene Smiley <eug+plug@esmiley.net>
Anyone know of anything that already exists that does this before I go at it?

How about this (untested) shell script in a cron job?

#!/bin/sh -
auto_send=`{ ls -t file_to_send* | tail -n1; } 2> /dev/nul`
[ "$auto_send" ] && cat "$auto_send" | mailx -s 'Subject' user@example.com

JP you are shameless. ;) Thanks for the help. Right now all my books are in boxes ready to be moved to Ft. Lauderdale next week. I may even HAVE that bash book, but I'm not about to tear through a bunch of boxes to find it!


Ok. Lemme see if I can understand this.

Set autosend to be the name of the one file (sorted by mod_time). Disregard error messages. Check if there is anything in $autosend and if so pipe it to mailx.

Am I understanding it rightly?
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug