This should be simple, but it doesn't seem to be working. I have a very simple script run by cron:
export MAILTOemail@example.com MAILTOfirstname.lastname@example.org echo "MAILTO is set to $MAILTO"
Cron, however, seems to not be picking up the MAILTO variable - the cron e-mails look, in part, like this:
X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/home/deploy> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=deploy> Date: Thu, 20 Sep 2012 13:05:01 -0700 MAILTO is set to email@example.com
What am I missing? Why isn't cron picking up the environment variables set in the script?