bug-texinfo
[Top][All Lists]
Advanced

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

Re: "[7031] filter_files zero return status" commit not working on OpenB


From: Ingo Feinerer
Subject: Re: "[7031] filter_files zero return status" commit not working on OpenBSD
Date: Sun, 22 May 2016 09:40:08 +0200
User-agent: Mutt/1.6.1 (2016-04-27)

On Sat, May 21, 2016 at 07:02:46PM +0100, Gavin Smith wrote:
> OK, so with this shell any "eval" statement can cause an exit under
> "set -e", regardless of the context of the statement?
> 
> Is this code wrong (in "run_tex")?
> 
>   verbose "$0: Running $tex_cmd ..."
>   if eval "$tex_cmd" >&5; then
>     case $out_lang in
>       dvi | pdf ) move_to_dest "$in_noext.$out_lang";;
>     esac
>   else
>     error 1 "$tex exited with bad status, quitting."
>   fi
> 
> If "$tex_cmd" fails, then an exit will be triggered, and the error
> message "exited with bad status" won't be given.

Yes, I think so. I tried with following program:

--8<-------------------------------------------------------------------
#! /bin/sh

set -e

if eval false; then
  echo "foo"
else
  echo "bar"
fi
--8<-------------------------------------------------------------------

and it generates no output at all (without "set -e" it prints "bar").

> Should parentheses around the "eval" be used here?

With

if (eval false); then

it prints "bar" irrelevant of "set -e".

So parentheses seem do work (but I do not know if there are other side
effects to care about as I am not a shell script expert).

Best regards,
Ingo



reply via email to

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