Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Dale R. Worley
Rusty Bird writes: >> The behavior of set -e is extremely surprising [...] > Has it ever been considered to add something like 'shopt -s > composable_compound'? Roughly meaning "execution and exit status of a > compound command are not changed by surrounding context (in the sense > of logical

Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Rusty Bird
Greg Wooledge: > The behavior of set -e is extremely surprising, and people should > stop expecting it to make intuitive sense. The best way to avoid being > surprised by it is to stop using it altogether. Has it ever been considered to add something like 'shopt -s composable_compound'? Roughly

Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Léa Gris
On 17/11/2020 at 16:00, Ilkka Virta wrote: Now, perhaps that could use a note explicitly saying this also means subshells, even though they may have set -e in effect independently of the main shell. The part explaining subshells (3.7.3 Command Execution Environment) could perhaps also use a

Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Ilkka Virta
On Tue, Nov 17, 2020 at 4:07 PM Pierre Colombier via Bug reports for the GNU Bourne Again SHell wrote: > #2 > pierre@zebulon: ~ $ (set -e ; echo A ; false ; echo B ) && echo C.$? > #3 > pierre@zebulon: ~ $ bash -c 'set -e ; echo A ; false ; echo B ' && echo > C.$? If it's not a bug, I

Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Greg Wooledge
On Tue, Nov 17, 2020 at 09:35:35AM +0100, Pierre Colombier via Bug reports for the GNU Bourne Again SHell wrote: >     I'm not sure this is actually a bug since dash act the same way but > it's quite unexpected for the average user Agreed! The behavior of set -e is extremely surprising, and

use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Pierre Colombier via Bug reports for the GNU Bourne Again SHell
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall$ uname output: Linux zebulon