This is a nit, but where Hans referred to "pipe commands", I would use
"piped commands". To me, the pipe "commands" would be the '|' symbols
themselves for invoking the pipes. Not important, just my grammatical
foible.
Hans gave this example:
( ls /tmp/afjkasdlf | grep georg | echo; pipestat=( ${PIPESTATUS[@]} );
echo "<${pipestat[0]}>"; echo "<${pipestat[1]}>" )
ls: cannot access /tmp/afjkasdlf: No such file or directory
<2>
<1>
larry@triggerfish:~$ ./test
cat test
( ls -l hs* | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<1>
echo rv=<1>
4th rv=<1>
larry@triggerfish:~$ ./test
cat test
( ls -l hs* | grep log | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<141>
echo rv=<141>
4th rv=<141>
larry@triggerfish:~$ man grep
larry@triggerfish:~$ ./test
cat test; sync
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<0>
echo rv=<0>
4th rv=<0>
larry@triggerfish:~$ ./test
cat test;
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<0>
echo rv=<0>
4th rv=<0>
larry@triggerfish:~$ ./test
cat test
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<141>
echo rv=<141>
4th rv=<141>
larry@triggerfish:~$ ./test
cat test ;
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<141>
echo rv=<141>
4th rv=<141>
larry@triggerfish:~$ ./test
cat test;
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<141>
echo rv=<141>
4th rv=<141>
larry@triggerfish:~$ ./test
cat test; sync
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<141>
echo rv=<141>
4th rv=<141>
larry@triggerfish:~$ ./testBut adding a trailing semicolon fixed it again.
cat test; sync;
( ls -l test | grep test | echo; pipestat=( ${PIPESTATUS[@]} );
echo "ls rv=<${pipestat[0]}>"; echo "grep rv=<${pipestat[1]}>"; echo "echo rv=<${pipestat[1]}>"; echo "4th rv=<${pipestat[1]}>" )
ls rv=<0>
grep rv=<0>
echo rv=<0>
4th rv=<0>
larry@triggerfish:~$