Discussion:
[ast-developers] ksh: wrong return code
Michal Hlavinka
2014-07-09 14:46:40 UTC
Permalink
Hi,

we've found a regression in ksh:

ksh -c 'function f { echo bar | read; return 1;}; o=$(f); echo $?;'

prints 0 instead of 1 (most of the time)

Addition of any command after the read makes it return 1 reliably:
... { echo bar | read; true; return 1; }

Michal

Loading...