[Top][All Lists]

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

shell trap builtin in rules

From: Martin Sebor
Subject: shell trap builtin in rules
Date: Mon, 06 Nov 2006 16:01:01 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417

I must be missing something but I don't see why the trap special
builtin wouldn't work the same in a make rule as in shell. Could
someone enlighten me? I expect the make output below to be 1 but
I get 0 instead.

$ (trap 'echo $?' EXIT && exit 1)
$ echo "foo:; trap 'echo \$\$?' EXIT && exit 1" > mf \
  && gmake -f mf foo
trap 'echo $?' EXIT && exit 1
gmake: *** [foo] Error 1

Thanks in advance!

reply via email to

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