[Top][All Lists]

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

Re: shell trap builtin in rules

From: Martin Sebor
Subject: Re: shell trap builtin in rules
Date: Thu, 09 Nov 2006 18:49:32 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417

I raised the question on the Austin Group list:

Eric Blake points out that this difference in behavior is a known
portability problem in historical shells:

The issue is documented in the Autoconf manual:


Martin Sebor wrote:
Paul D. Smith wrote:

On Wednesday, 8 November, Martin Sebor (address@hidden) wrote:

It works for me.  Maybe it's your shell?

Apparently. I originally ran my code on Solaris. I have tried
/usr/xpg4/bin/sh but got the same results. AIX, HP-UX, IRIX,
and Tru64 all behave the same as well. Bash is the only shell
that produces the result I expect.

Odd.  Can you try this without make involved; what behavior do you get?

    $ /bin/sh -c "trap 'echo \$?' EXIT && exit 1"


Also, try using "0" instead of EXIT; maybe the other shells don't accept the
translated values?

With /bin/sh the script above prints 0, with both EXIT and 0.
So the bahavior has nothing to do with make. I'll dig into
the shell spec to see if conforms or if it's a bug. Thanks
for your help!


Help-make mailing list

reply via email to

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