LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-30-2009, 09:51 PM   #1
at-user
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
"at" command with day of week


Today, Wednesday 30 December 2009, at 8:00 AM, I entered the
following 'at' command:
at 9:30 AM Friday

I continued with my commands and ctl-D, and was surprised
to receive the following output:
job 96 at Sat Jan 1 09:30:00 2011

A quick check with atq confirmed:
96 Sat Jan 1 21:30:00 2011 a atusr

I really was expecting to see Fri, Jan 1, 2010.
Can anyone explain this?

(BTW, I'm running Ubuntu Karmic, pretty much out-of-the-box.)
 
Old 12-30-2009, 11:28 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,784

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
What do you get when you run "date"? Does it tell you your system time is set for 2009 or 2010?
 
Old 12-31-2009, 08:57 AM   #3
at-user
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
"at" -- system date/time OK

Yes, "date" shows correct date and time (thanks, ntpd!). Also,
to keep the post short I didn't mention some variations of the
time specification that I also tried. It's now 6:40 AM, Thu
31 Dec. Here are some other "at" commands and results:

1. "at 8:00 AM today" gives job at "Thu Dec 31 08:00:00 2009"
2. "at 8:00 AM tomorrow" gives job at "Sat Jan 1 08:00:00 2011"
3. "at 8:00 AM + 24 hours" gives job at "Fri Jan 1 08:00:00 2010"

Strange, no?
 
Old 12-31-2009, 12:08 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,165

Rep: Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506
That looks like a bug in the 'at' command. I have tried it in version 3.1.9 on Debian and it reproduces.

jlinkels
 
Old 12-31-2009, 12:25 PM   #5
at-user
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
"at" - it _is_ a bug

I did finally find the bug report page for "at", and this turns
out to be a very old bug - reported in 2006 and still active.

Given the complexity of the POSIX time specs, it isn't surprising
that there are quite a few parsing bugs in the "at" program; what
does surprise me is that they aren't using (or don't have) a well-
tested GNU library to do the parsing.
 
Old 12-31-2009, 02:46 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,165

Rep: Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506
The date command calculates correctly. Indeed one wonders why these commands use different libraries.

jlinkels
 
  


Reply

Tags
at


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me fix my "day of the week" script mattp Linux - Newbie 13 07-13-2009 02:53 PM
how to get the first and the last day in the month with "date" command myhnet Linux - Newbie 9 06-16-2009 03:16 AM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM


All times are GMT -5. The time now is 03:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration