#!/bin/sh # Within cron set it up so that every Friday, grab the latest column # of 'The Straight Dope' and mail it out to the specified recipient now="$(date +%y%m%d)" url="http://www.straightdope.com/columns/${now}.html" to="taylor" ( cat << EOF Subject: The Straight Dope for $(date "+%A, %d %B, %Y") From: Cecil Adams Content-type: text/html To: $to
THE STRAIGHT DOPE
EOF lynx -source "$url" | \ sed -n '/
/,$p' | \ sed 's|src="../art|src="http://www.straightdope.com/art|' |\ sed 's|href="..|href="http://www.straightdope.com|g' echo "
" ) | /usr/sbin/sendmail -t exit 0