Is there a way to make this perl code capture stderr as well as stdout from a tcsh?
- by mikelong
open UNIT_TESTER, qq(tcsh -c "gpath $dir/$tsttgt; bin/rununittests"|);
while(<UNIT_TESTER>){
reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /core dumped/;
reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /\[ FAILED \]/;
writelog($tsttgt,$_);
}
close UNIT_TESTER;
I have tried to redirect stderr to stdout using this syntax but it didn't work:
open UNIT_TESTER, qq(tcsh -c "gpath $dir/$tsttgt; bin/rununittests >& "|);
I have also read the discussion on the perl FAQ but that was in relation to bash: http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q5.15.html