Em bash
, sabe-se que set -e
ele é ignorado em substituições de comando (a menos que inherit_errexit
esteja habilitado).
Entretanto, quando false
command é executado em substituição de comando, set -e
NÃO é ignorado. Por quê?
Código:
set -e
shopt | grep inherit_errexit
echo hello
a=$(false)
echo world
Esperado:
inherit_errexit off
hello
world
Real:
inherit_errexit off
hello
shell returned 1