GNU bug report logs - #7877
sleep takes undocumented hex args

Previous Next

Package: coreutils;

Reported by: jidanni <at> jidanni.org

Date: Fri, 21 Jan 2011 00:09:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: jidanni <at> jidanni.org
Subject: bug#7877: closed (Re: bug#7877: sleep takes undocumented hex args)
Date: Fri, 21 Jan 2011 19:22:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#7877: sleep takes undocumented hex args

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 7877 <at> debbugs.gnu.org.

-- 
7877: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7877
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 7877-done <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#7877: sleep takes undocumented hex args
Date: Fri, 21 Jan 2011 20:28:56 +0100
Paul Eggert wrote:
> On 01/21/2011 01:24 AM, Jim Meyering wrote:
>> My first reflex was to make sleep reject args like 0x... and inf.
>
> My reflex was just the opposite: why reject a notation
> that might be useful?

I see that at least freebsd's /bin/sleep and the one from sunos 5.11
work just like the one from coreutils (without my proposed change)
in accepting e.g., 0x1 and inf.

netbsd's accepts 0x1 but not inf.
openbsd's accepts neither.

> Several other programs (printf, seq, sort, tail, plus many
> other GNU programs) also use strtod or strtold.  If 'sleep' is
> changed to reject hexadecimal and infinity, shouldn't they
> be changed too, for consistency?
>
> I expect it's better to leave these programs alone.  Not only
> is this simpler, and a tiny bit cheaper at runtime, it's slightly
> less likely to break existing usage.
>
> Anyway, whatever we do, we should document it better.  To start the ball
> rolling on that, I pushed the following change, which documents the
> existing behavior.  We can change this if we change the behavior.

The above, plus your added documentation are good enough
reasons to leave sleep as-is.

Thanks.

[Message part 3 (message/rfc822, inline)]
From: jidanni <at> jidanni.org
To: bug-coreutils <at> gnu.org
Subject: sleep takes undocumented hex args
Date: Fri, 21 Jan 2011 07:31:18 +0800
The documentation doesn't say that one can also use hex args:
$ time /bin/sleep 0x10
real    0m16.007s
However not octal args:
$ time /bin/sleep 010
real    0m10.003s
Maybe say how too.



This bug report was last modified 14 years and 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.