*NOTE: Moderators, if this doesn't belong here, please move as you see fit.

I like to dabble in shell scripting on various UNIX-based systems we have to automate things. I mostly use C-shell. In a number of my scripts, I send e-mail notifications using the built-in mail functionality.

A simple script would contain these lines:

echo "From: tomjones@mycompany.com" > /tmp/message
echo "Subject: Notification" >> /tmp/message
echo "Hi John. Here is your notification." >> /tmp/message
mail johndoe@hiscompany.com < /tmp/message

How would I attach a PDF file to this simple message to send to John? The O'Reilly sendmail manual hasn't been much help. I've Googled around and can't find anything C-shell-ish that works. I've viewed the source of an incoming e-mail that has a PDF attachment and tried various iterations using the Content arguments I found. Can't get anything to work.

Any ideas would be appreciated. Thanks.