#!/bin/bash # make sure the file exists. if [ ! -f "$MAIL" ]; then echo Your mailbox appears to be empty. exit 0 fi # a command for sed that strips out what we care about. export SEDCMD='/Subject:/s/Subject: *\(.*\)$/[ \1 ]/p' # show the title. echo "Your mail messages resemble these:" echo "" # dump the mail out. grep '^Subject:' $MAIL | sed -n -e "$SEDCMD" | tr '\n' ' ' | $BINDIR/splitter echo ""