Hi,
/bin/ksh is not a Korn shell on our system. It is AT&T sh (version 1993-12-28 p). This shell supports pipefail, but apparently not correctly. $? is set correctly, but somehow gnu-make doesn't catch it.
/bin/sh on our system is bash 2.05, this one doesn't support pipefail. The adminstrators installed it this way, probably for historic reasons. The system is RedHat Enterprise Linux 3. The default shell we work in is /bin/ksh.
I'm also not happy with this shell specific solution, but I have not found a better way to do it.
By the way, we found a workaround for our /bin/ksh. If we add
; exit $$?
at the end of the line in the makefile it works.
On Wed, 2007-06-20 at 17:32 +0200, Erwin Waterlander wrote:
> I compiled bash 3.2 locally. When I set
> SHELL=/home/waterlan/src/bash-3.2/bash -e -o pipefail everything
> works as expected. So the problem must be in the AT&T sh.
As far as I know, ksh doesn't support pipefail. If so, it's not a
"problem" in that shell; the problem is you're trying to use a
bash-specific extension (pipefail option) in a shell other than bash.
Personally, I would be very unhappy to run across a makefile that was
built to only work with bash and no other shell. I realize it's messy
to handle errors from early commands in pipelines, but it IS possible to
do in standard sh without using extensions.
Regardless, at least if you set SHELL in the makefile to bash it will be
clear what's required so that's a good thing.
Cheers!
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist