R. Diez
2017-08-08 09:51:11 UTC
Hi all:
When I run this test script:
#!/bin/bash
test ()
{
shopt -s execfail
exec "non-existing-command"
echo "This message should therefore always appear."
}
test
(test)
test &
The output is:
$ ./execfail-test.sh
./execfail-test.sh: line 6: exec: non-existing-command: not found
This message should therefore always appear.
./execfail-test.sh: line 6: exec: non-existing-command: not found
./execfail-test.sh: line 6: exec: non-existing-command: not found
That is, it looks like execfail is being ignored in the subshells.
Is that a bug? Or have I missed something?
Thanks in advance,
rdiez
When I run this test script:
#!/bin/bash
test ()
{
shopt -s execfail
exec "non-existing-command"
echo "This message should therefore always appear."
}
test
(test)
test &
The output is:
$ ./execfail-test.sh
./execfail-test.sh: line 6: exec: non-existing-command: not found
This message should therefore always appear.
./execfail-test.sh: line 6: exec: non-existing-command: not found
./execfail-test.sh: line 6: exec: non-existing-command: not found
That is, it looks like execfail is being ignored in the subshells.
Is that a bug? Or have I missed something?
Thanks in advance,
rdiez