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

2008-11-10 Thread Paolo Bonzini
> 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:

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

2008-11-10 Thread Eric Blake
Ralf Wildenhues gmx.de> writes: > > zsh provides a print(1) which has -r, I don't know since which version. > It does not set TMOUT by default. Did you try zsh before applying the > patch? You're right: at least zsh 4.3.4 provides print(1) which passes the test (if we were to remove the ZSH_V

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

2008-11-10 Thread Ralf Wildenhues
* Eric Blake wrote on Mon, Nov 10, 2008 at 09:50:39PM CET: > Ralf Wildenhues gmx.de> writes: > > > Where did you get the idea that TMOUT is a reliable way to detect ksh? > > You're right - the existence of TMOUT is not a reliable way to detect > ksh, and I had better not document it as such. Ho

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

2008-11-10 Thread Eric Blake
Ralf Wildenhues gmx.de> writes: Hi Ralf, and thanks for the thoughts, > > Your filter based on TMOUT is different > > than my filter on {BASH,ZSH}_VERSION; I could go either way (I tested that > > pdksh also supplies both $TMOUT and print). > > Who guarantees you that ksh supplies TMOUT? On

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

2008-11-10 Thread Ralf Wildenhues
Hello, * Eric Blake wrote on Mon, Nov 10, 2008 at 05:30:27PM CET: > Paolo Bonzini gnu.org> writes: > > > 1) these tests do cost a few subshells (which can be as expensive as a > > fork on bash, even if the executed command is a builtin). In the > > attached patch I conditionalized it on ${TMOUT

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

2008-11-10 Thread Eric Blake
Paolo Bonzini gnu.org> writes: > > At any rate, that means we should probably teach m4sh to try "print -r --" > > as one of its options, prior to "printf %s\\n", during _AS_ECHO_PREPARE. > > Maybe, also because in that case we have "print -r -n --" too. But: > > 1) these tests do cost a few su

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

2008-11-10 Thread Paolo Bonzini
> 'man print' on Solaris 10 shows that ksh also understands "print -R -" as > a way to print "-" (but not "-n" or "--"). But you are right in realizing > that "print -r --" seems to work nicely. Yes, and "print -R" is broken on pdksh in that "print -R -n -n" should print "-n" (it does on Darwin'

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

2008-11-10 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Paolo Bonzini on 11/10/2008 5:06 AM: >> 1) I don't have access to systems that are old or weird enough to check >> if the performance penalty will happen often. What do you think? A single-fork fallback is better than nothing, and better