system return value?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I'm doing the following:

system ("make | tee /tmp/make.log") == 0 || die "Make failed $?\n";

The problem is that the pipe tee is what is getting returned for a
status. Is there anyway around this problem? The make fails but my
script doesn't exit out....

Thanks in advance!

Re: system return value?

2007-01-26 wrote
Quoted text here. Click to load it

How about launching your "make" in a open call?

open MAKE, "make|" or die "open: $!";
while (<MAKE>)
  print STDERR $_;
my $exit_code_from_make = close MAKE;

/Morten %-)

Re: system return value? wrote:
Quoted text here. Click to load it

    How perverse do you wish to be:

system 'var=`((make; echo $?>&3) | tee /tmp/make.log) 3>&1`; exit $var ';

              Just because I've written it doesn't mean that
                   either you or I have to believe it.

Re: system return value?

Quoted text here. Click to load it

Interesting, but it no longer gets any output to the screen. Does get
the exit


Site Timeline