autoconf
[Top][All Lists]
Advanced

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

Re: [PATCH 6/6] use print or printf or cat as $ECHO


From: Paolo Bonzini
Subject: Re: [PATCH 6/6] use print or printf or cat as $ECHO
Date: Tue, 11 Nov 2008 07:06:58 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

> Who guarantees you that ksh supplies TMOUT?  OTOH, TMOUT is not in any
> way restricted, so a user (more likely: a sysadmin) could set and export
> it, and reasonably so: every Posix shell understands it, bash included.

I tested that both ksh and pdksh set TMOUT = 0 at startup, for example:

  $ ksh
  [033]0;h - w007]h:w u$ unset TMOUT
  [033]0;h - w007]h:w u$ ksh -c "echo \$TMOUT"
  0

bash, zsh, ash/dash do not.

> And since when are 2 forks a suitable tradeoff for portability?

It's just a guard to avoid unnecessary tests, like

  test "${TMOUT+set}" = set && (...) 2>/dev/null

It's not affecting portability.

> Should we document $TMOUT as a reliable way to detect ksh, the way we already 
> use {BASH,ZSH}_VERSION as reliable witnesses of those two shells?

Maybe; in any case, if we aren't saying it already we should point out
that they can be exported and this affects the tests.

Paolo




reply via email to

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