Hi,
I have a make file which I try to execute, but it failed when it arrived to the line:
for r in ${PIPESTATUS
[*]}; do if (($r != 0)); then exit $r; fi;done;
With the Error:
""make:/bin/sh: Bad substitution""
Or the Error:
"make:${PIPESTATUS[...}: Bad substitution"
(Depend on the operating system).
I assume that there is a problem with the shell. `${PIPESTATUS[*]}' is actually an aray - a functionality which isn't supported by all the shells. So it might work in one shell, but don't work in others. Here is a proof:
you can reset the shell in your Makefile by putting:
SHELL:=/bin/bash
if you are using GNU Make.
PS: My guru has also developed a means for checking exit status of pipes which is portable to all the shells and all the Unix-platform. If you are interested you might have a look at `http://sf.net/projects/pipestatus'. That's a shell library by sourcing which you could get access to several highly portable shell functions for handling pipes, like `runpipe', `checkpipe' etc.