[Top][All Lists]

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

Re: texinfo-tex-4.13a: texi2dvi fails to diagnose error

From: Eric Blake
Subject: Re: texinfo-tex-4.13a: texi2dvi fails to diagnose error
Date: Thu, 12 Jan 2012 20:19:02 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 01/12/2012 05:25 PM, Karl Berry wrote:
> Hi Eric, Jim,

Hello, and thanks for revisiting this.

>     > echo '\input texinfo.tex @bye' >txiversion.tex
>     Ouch - this is a non-portable use of echo.  You CANNOT expect backslashes
>     to make it through echo, but should use printf instead.
> Excuse my skepticism, but on what platform(s) does echo '\i' fail to
> pass the \?

Hmm, I guess you have a point.  Dash is a classic example of a shell
where echo eats backslash, but it only does so when it recognizes the
escape sequence, and \i is not a common escape sequence.  Still, better
safe than sorry by avoiding the potential portability trap in the first

$ dash -c 'echo "\\r"' | od -tx1z
0000000 0d 0a                                            >..<
$ dash -c 'echo "\\i"' | od -tx1z
0000000 5c 69 0a                                         >\i.<

> Thanks for reporting that, Jim.  Looks to me like it was breakage
> unknowingly introduced by someone "forcing" me to use set -e.  (Aside:
> curmudgeon that I am, I hate set -e, even though everyone else seems to
> love it.  Just seen so many warts introduced to placate it.  Like this
> one.  Sigh.)

I also hate set -e.  So many shells have buggy implementations of it;
and even if they had the same semantics, it tends to be unintuitive,
especially when mixed with shell functions.  That's why autoconf does
NOT use it.

>     if (
>       ...
>       printf %s\\n '\input texinfo.tex @bye' > txiversion.tex
>       $TEX txiversion.tex </dev/null >txiversion.out 2>txiversion.err
>     ); then
> Ok, I munged that into place, thanks Eric.  Hope if (...) is portable
> (in reality) as an if condition.  Never tried that before.

Yes, that's quite portable.  if has always taken _any_ command,
including a subshell, as its condition.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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