Hide Forgot
Description of problem: # set -o pipefail # cat /var/log/messages | head -n 111111> /dev/null; echo $? 0 # cat /var/log/messages | head -n 1> /dev/null; echo $? 141 Version-Release number of selected component (if applicable): coreutils-5.97-34.el5 coreutils-8.4-16.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. set -o pipefail 2.cat /var/log/messages | head -n 111111> /dev/null; echo $? 3.cat /var/log/messages | head -n 1> /dev/null; echo $? Actual results: 0 0 Expected results: 0 141 Additional info:
Didn't you interchange Actual and Expected behaviour? Both cases (2 and 3) should return 0 exit codes.
(In reply to comment #1) > Didn't you interchange Actual and Expected behaviour? Both cases (2 and 3) > should return 0 exit codes. Yes, you are absolutely correct. Actual and Expected behavior are interchanged.
I can't reproduce it; RHEL6: [root@localhost ~]# rpm -q bash coreutils bash-4.1.2-8.el6.x86_64 coreutils-8.4-13.el6.x86_64 [root@localhost ~]# set -o pipefail [root@localhost ~]# cat /var/log/messages | head -n 111111 > /dev/null; echo $? 0 [root@localhost ~]# cat /var/log/messages | head -n 1 > /dev/null; echo $? 0 RHEL5: [root@localhost ~]# rpm -q bash coreutils bash-3.2-32.el5 coreutils-5.97-34.el5 [root@localhost ~]# set -o pipefail [root@localhost ~]# cat /var/log/messages | head -n 111111 > /dev/null; echo $? 0 [root@localhost ~]# cat /var/log/messages | head -n 1 > /dev/null; echo $? 0