Subject: bug#9102: "timeout 0 FOO" should timeout right away

From: James Youngman <[email-masked]>
Date: Tue, 19 Jul 2011 23:41:17 +0100

2011/7/19 Pádraig Brady <[email-masked]>:
> On 19/07/11 23:00, James Youngman wrote:
>> 2011/7/17 Paul Eggert <[email-masked]>:
>>> On 07/17/11 05:31, Pádraig Brady wrote:
>>>> Well my reasoning for having "0" mean don't timeout,
>>>> was to have an easy way in scripts to specify no timeout
>>>
>>> That's a good thing to have, but it could be specified in
>>> a different way.  One possibility is the '1' (digit 1) option,
>>> e.g.,  "timeout -1 FOO".  Or if that's too clever, we could
>>> use some other letter for the option.
>>
>> I'm not sure that's worked out so well for tail.   But if we are
>> looking for an argument indicating we don't want a timeout, the
>> argument "never" is quite clear.
>
> I don't follow (pardon the pun).
> This will "sleep(0)" between polls which takes 10% of my cpu here:
>
>  tail ---disable -s0 -F nosuch

Sorry about the lack of clarity.  I was referring to the mess over
"tail -n 30", "tail -30", "tail +30" etc. and more specifically was
trying to indicate that I didn't think "timeout -0" would be a useful
direction, for that reason.  I'd suggest that Paul's shell snippet
could usefully be:

timeout=never
[ "$platform" = "buggy" ] && timeout=10
timeout $timeout command

James.

-- 
This email is intended solely for the use of its addressee, sender,
and any readers of a mailing list archive in which it happens to
appear.   If you have received this email in error, please say or type
three times, "I believe in the utility of email disclaimers," and then
reply to the author correcting any spellings (and, optionally, any
incorrect spellings), accompanying these with humorous jests about the
author's parentage.   If you are not the addressee, you are
nevertheless permitted to both copy and forward this email since
without such permissions email systems are unable to transmit email to
anybody, intended recipient or not.  To those still reading by this
point, the author would like to apologise for being unable to maintain
a consistent level of humour throughout this disclaimer.  Contents may
settle during transit.  Do not feed the animals.