Bug 486227 - "at" man page does not say that hyphenated dates are accepted
Summary: "at" man page does not say that hyphenated dates are accepted
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: at
Version: 10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-18 22:28 UTC by Steve Tyler
Modified: 2009-02-19 15:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-19 07:54:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steve Tyler 2009-02-18 22:28:30 UTC
Description of problem:

The man page for the "at" command does not mention hyphenated dates: YYYY-MM-DD.

Experiment shows that the at command accepts dates in the form YYYY-MM-DD.
Further, the grammar that comes with the package explicitly mentions hyphenated dates.

Version-Release number of selected component (if applicable):
at-3.1.10-26.fc10.i386

How reproducible:
Easily.

Steps to Reproduce:
1. $ echo 'date' | at 2009-02-18
job 24 at 2009-02-18 14:14

To save typing:
$ echo 'date' | at `date +%F`
job 26 at 2009-02-18 14:19

2. The job is accepted and runs immediately.
(It helps to have mail-notification installed.)

3. man at

Additional info:

The grammar in /usr/share/doc/at-3.1.10/timespec has:

%token  <charval> HYPHENDATE

Unfortunately, it doesn't give the syntax.

Comment 1 Marcela Mašláňová 2009-02-19 07:54:34 UTC
I'll change the man page in next release. In man is written "The exact definition of the time specification can be found in /usr/share/doc/at-3.1.10/timespec." which is true, but this is yacc specification, which isn't user friendly.

btw I suggest using "echo date | at now" instead of "echo 'date' | at `date +%F`". That's definitely save typing ;-)

Comment 2 Steve Tyler 2009-02-19 15:00:32 UTC
(In reply to comment #1)
> I'll change the man page in next release. In man is written "The exact
> definition of the time specification can be found in
> /usr/share/doc/at-3.1.10/timespec." which is true, but this is yacc
> specification, which isn't user friendly.

Thanks. It seems odd that the package includes the yacc and not the lex, which is also not user friendly.

From the yacc and the lex, it appears that "at" accepts both two and four digit years everywhere -- also not mentioned in the man page.

By experiment, all of these are accepted:
2009-02-19
19.02.2009
02192009

Similarly, day and month numbers can be one or two digits.
2009-3-1
1.3.2009

But not here:
$ echo 'date' | at 312009
Error in month number. Last token seen: 312009
Garbled time

> btw I suggest using "echo date | at now" instead of "echo 'date' | at `date
> +%F`". That's definitely save typing ;-)

That was intended to avoid this:
$ echo 'date' | at 2009-02-18
at: refusing to create job destined in the past


Note You need to log in before you can comment on or make changes to this bug.