in reply to Re^4: How to know the status of a command invoked by open function?
in thread How to know the status of a command invoked by open function?

Yes, very weird. You'd get zero if ls managed to finish before close closed the pipe, but that's not very likely. Or maybe AIX processes in general or AIX's ls specifically behave differently when they encounter a closed pipe. Or maybe the shell doesn't relay the death of the child to its parent in AIX.

On AIX, what output do you get from

/bin/sh -c 'perl -e'\''kill TERM => $$'\''' ; echo $?

Replies are listed 'Best First'.
Re^6: How to know the status of a command invoked by open function?
by zhujian0805 (Sexton) on Aug 16, 2011 at 01:56 UTC
    # /bin/sh -c 'perl -e'\''kill TERM => $$'\''' ; echo $? Terminated 143
      That rules out the last of the possibilities I listed.