help-make
[Top][All Lists]
Advanced

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

Re: getting status on first element of pipeline


From: Paul D. Smith
Subject: Re: getting status on first element of pipeline
Date: Mon, 12 May 2003 11:23:25 -0400

%% Dan DeJohn <address@hidden> writes:

  dd> $R/%/c : FORCE
  dd>        $(MAKE) -r -C $@/src all 2>&1 | tee $@/make_output

  dd> This works, and puts the make output where I want, but now the
  dd> return code from the submake comes from the tee command, which
  dd> always succeeds.  So now the master make doesn't know that one of
  dd> the submakes has failed.

  dd> I can't find any way to have the submake return the status of the
  dd> make command instead of tee. Any ideas?

This has nothing to do with make: make is exiting with its exit code
just as it always does.

This is a shell issue: the exit code of a pipeline is always the exit
code of the last command in the pipeline.  There's absolutely nothing
any individual command in the pipeline can do to change this.


You want to ask this question ("how do I get the return code from the
first command in a pipeline?") on a list/group dedicated to shell
programming, such as comp.unix.shell.

Good luck!

-- 
-------------------------------------------------------------------------------
 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




reply via email to

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