Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

Posix shell pipe exit code array

Dan Martin_1
Frequent Advisor

Posix shell pipe exit code array

There used to be a special array in the HP posix shell that was loaded with the exit codes of each command in an executed pipe, ie:

echo "aaa" | sed 's/aaa/bbb/' | grep aaa

echo ${ARRNAME[1]} # Returns exit code of sed

ARRNAME, of course, is what I don't remember, and it seems to have disappeared from the documentation. Did it disappear from the posix shell also?

Dan
2 REPLIES
Mike Stroyan
Honored Contributor

Re: Posix shell pipe exit code array

Perhaps you were thinking of bash shell and echo ${PIPESTATUS[1]} .
Highlighted
Dan Martin_1
Frequent Advisor

Re: Posix shell pipe exit code array

Mike,

That is quite possible. I have been known to get the old wires crossed before.

Thanks,
Dan