On Sat, Sep 3, 2011 at 4:42 PM, Brett Glass <[email protected]> wrote:

>
> One way to avoid problems would be to create a file name from a timestamp
> and a pid.
>
> The key thing, though, is to avoid mailing on machines that don't have
> mail.
>

Call a shell script which preforms the actions you want.

Regular old /bin/sh scripting is a worthwhile skill:

Something quick:

#!/bin/sh
OUTPUT=$(your/app)
if [ -e /usr/sbin/sendmail ]; then
  echo $OUTPUT | mail -s "Subject" $USER
else
  echo $OUTPUT > ${USER}_`date +\%Y\%m\%d`.log
fi

-- 
Adam Vande More
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to