bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using TMOUT as default for read bultin is unwise


From: Stephane CHAZELAS
Subject: Re: Using TMOUT as default for read bultin is unwise
Date: Wed, 28 Mar 2012 18:26:23 -0000
User-agent: slrn/pre1.0.0-18 (Linux)

2011-09-14, 09:46(+01), Wheatley, Martin R:
[...]
> Description:
>       The contents of the environment variable TMOUT are used are the
>       default timeout for the read builtin command when reading from
>       a TTY or pipe AND as a shell command input idle time.
>
>       This can lead to random failures of shell scripts
[...]
>       I think the TMOUT should not be overloaded and its use as a default 
> value
>       for the read builtin - especially for sub-shell pipelines is dangerous
>       and should be discontinued otherwise all bash scripts that use the read 
> builtin
>       need to be modified to include TMOUT=0.

That's not the only problematic variable. See also
http://groups.google.com/group/comp.unix.shell/browse_thread/thread/cf7d5147dd829cf9/ef5b5b49a676b99d#ef5b5b49a676b99d

And here is what Geoff Glare from the Austin Group (the body
behind POSIX) had to say when I raised it some time ago:
http://groups.google.com/group/comp.unix.shell/browse_thread/thread/60c3e67919c36d0a/25ab970d275ecdb7#25ab970d275ecdb7

In short: if one sets a TMOUT environment variable, the easy
fix is to tell them: DON'T!

-- 
Stephane


reply via email to

[Prev in Thread] Current Thread [Next in Thread]