When using a backslash (\) to escape a percent-sign (%) in a command, vixie cron passes the escape character to the command along with the percent-sign. Reproducible: Always Steps to Reproduce: 1. crontab -e 2. create command: -s "Message from `hostname` (`date '+\%A, \%B \%d \%Y'`)" admin@leaguehost.net 3. exit 4. wait Actual Results: E-mail subject: Message from home (\Saturday, \June \26 \2004) Expected Results: E-mail subject: Message from home (Saturday, June 26 2004)
Step #2 *should* read: 2. create command: 0 * * * * /bin/mailx -s "Message from `hostname` (`date '+\%A, \%B \%d \%Y'`)" admin@leaguehost.net
This appears to be a feature... AFAICS, vixie-cron only replaces % with a newline when it's not inside a quoted string. When you're using "" or '' the \ is unnecessary.
vixie-cron 4.1 seems to handle this better.