ksh doesn't return the exit code of the last command within a pipe
Issue
- ksh doesn't return the exit code of the last command within a pipe
- How to reproduce
[root@localhost ~]# rpm -iv ksh-20120801-10.el6.x86_64.rpm
Preparing packages for installation...
ksh-20120801-10.el6
[root@localhost ~]# ksh
# A=`false | true`; echo $?
0
# exit
[root@localhost ~]# rpm -Fv ksh-20120801-10.el6_5.9.x86_64.rpm
Preparing packages for installation...
ksh-20120801-10.el6_5.9
[root@localhost ~]# ksh
# A=`false | true`; echo $?
1
Environment
- Red Hat Enterprise Linux (RHEL) 6
- ksh-20120801-10.el6_5.9.x86_64.rpm
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.