$ uname -a Linux <edited> 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:56:11 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux $ /bin/ksh --version version sh (AT&T Research) 93t+ 2009-01-20 $ cat works #!/bin/ksh echo hi | while read f do cat notarealfile || echo fails done $ ./works # The result is expected. cat: notarealfile: No such file or directory fails $ cat broken #!/bin/ksh echo hi | while read f do cat notarealfile || echo fails done exit 0 $ ./broken # The exit status of 'cat notarealfile' will incorrectly be 0, so 'fails' will not be printed. cat: notarealfile: No such file or directory $ diff works broken # All we did was add 'exit 0' 6a7 > exit 0 $
this bug was introduced in upstream ksh 2009-01-20 and fixed in upstream ksh 2009-02-02
this bug exists only in ksh 2009-01-20, but RHEL 5 contains ksh 2008-02-02