[Bug 1110147] [NEW] Error in manual
Abel Lopez
al592b at att.com
Wed Jan 30 08:17:04 UTC 2013
Public bug reported:
The manual for crontab(5) shows various examples of using the date command as such:
$(date +%u)
This contradicts the note specifying that any % sign needs to be escaped
Entering something like that as a command for execution fails to
interpret anything past the % sign.
so, for example:
* * * * * echo $(date +%Y)
fails with
/bin/sh: 1: Syntax error: end of file unexpected (expecting ")")
The syslog shows this
CRON[10104]: (root) CMD (echo $(date +)
Simply escaping the % resolves it, so in this example, the manual should
be updated so that each 'date' example looks as
$(date +\%u) - or whatever the format character example is.
My example cron from above executes as expected as
* * * * * echo $(date +\%Y)
which send me an email simply with "2013"
** Affects: cron (Ubuntu)
Importance: Undecided
Status: New
** Patch added: "cron-man.patch"
https://bugs.launchpad.net/bugs/1110147/+attachment/3507174/+files/cron-man.patch
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cron in Ubuntu.
https://bugs.launchpad.net/bugs/1110147
Title:
Error in manual
Status in “cron” package in Ubuntu:
New
Bug description:
The manual for crontab(5) shows various examples of using the date command as such:
$(date +%u)
This contradicts the note specifying that any % sign needs to be
escaped
Entering something like that as a command for execution fails to
interpret anything past the % sign.
so, for example:
* * * * * echo $(date +%Y)
fails with
/bin/sh: 1: Syntax error: end of file unexpected (expecting ")")
The syslog shows this
CRON[10104]: (root) CMD (echo $(date +)
Simply escaping the % resolves it, so in this example, the manual
should be updated so that each 'date' example looks as
$(date +\%u) - or whatever the format character example is.
My example cron from above executes as expected as
* * * * * echo $(date +\%Y)
which send me an email simply with "2013"
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cron/+bug/1110147/+subscriptions
More information about the foundations-bugs
mailing list