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: Jim Meyering <jim <at> meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: "7877 <at> debbugs.gnu.org" <7877 <at> debbugs.gnu.org>, "jidanni <at> jidanni.org" <jidanni <at> jidanni.org>
Subject: bug#7877: sleep takes undocumented hex args
Date: Fri, 21 Jan 2011 12:37:55 +0100
Voelker, Bernhard wrote:
> Jim Meyering wrote:
>> That's an artifact of GNU sleep using strtod, which means "inf" and
>> "INFINITY" are also accepted:
>>
>>     $ timeout 1 sleep inf
>>     [Exit 124]
>
> what's wrong with `sleep inf`?

Hi Volker,

There's nothing terribly _wrong_ with it, but I am inclined not to
add the feature for the same reason I don't want to simply document
that sleep accepts 0x10 and treats it like "16": those are incidental
implementation details.  Once we document such a thing, we then commit to
ensuring it works everywhere, and in a sense encourage people to use the
"feature".  However, officially supporting "inf" doesn't gain much, yet
imposes a portability burden: does every strtod implementation convert
"inf" to something reasonable?  I doubt it.

If you want to sleep for a long time, you can use
sleep $(echo 2^32|bc) or sleep 999999d.

If you're worried that 2700 years is not enough ;-), use this:

    while :; do sleep 99d || break; done




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

Previous Next


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