Hi, 

Is the following behaviour intended or a bug in bash (3.1.17(1)-release)? The 
command list 
  (set -e; false; echo hello)

does not print hello and has non-zero exit status. All fine. If I try to use 
this fact to display an error message the semantics changes. The following 
command

  (set -e; false; echo hello) || echo fail

_does_ print hello _rather_ than fail. Why is this? One could argue that the 
first echo command is now part of an OR-list, but this on the parent-shell 
level (where set -e has no other effects) and via the command list, and not in 
the subshell.

A corresponding change occurs if the command list is part of an AND-list.

Please CC this address since I'm not on the list. 

Thanks,

Johan Hovold



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to