[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7877: sleep takes undocumented hex args
From: |
Jim Meyering |
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
bug#7877: sleep takes undocumented hex args, Jim Meyering, 2011/01/21