It is expected that the shell aborts in such case, but bash3 doesn't: $ sh -efu -c 'x=iii; echo foo | while ! [ "$x" = "" ]; do x="${x%i}"; false; echo "$x"; done; echo "END: $?"' END: 1 $ sh4 -efu -c 'x=iii; echo foo | while ! [ "$x" = "" ]; do x="${x%i}"; false; echo "$x"; done; echo "END: $?"' $ bash4 behaves as expected. (I actually didn't notice an error in my script because of this...) $ sh --version GNU bash, version 3.2.57(1)-release (x86_64-alt-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. $ sh4 --version GNU bash, version 4.3.42(1)-release (x86_64-alt-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $