hush: fix set -n to act immediately, not just after run_list()

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-09-07 02:23:51 +02:00
parent f415e21a7d
commit e53c7dbafc
6 changed files with 21 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
Start
Ok:0

View File

@@ -0,0 +1,7 @@
$THIS_SH -c '
cleanup() { set +e; false; }
set -e
trap cleanup EXIT
echo Start
'
echo Ok:$?

View File

@@ -0,0 +1,3 @@
set -n stops in -c?
YES
Ok:0

View File

@@ -0,0 +1,2 @@
$THIS_SH -c "echo 'set -n stops in -c?'; set -n; echo NO" && echo YES
echo Ok:$?