summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-10 10:33:10 +0200
committerDenys Vlasenko2017-07-10 10:33:27 +0200
commitb057806a6ad7618b10db062bf6c71d09f71ce421 (patch)
treec0f9fa4df708e768d7f3f3e1337400633702510e /shell/hush.c
parent9e55a156f8a07297f620466e8173040336a7c48c (diff)
downloadbusybox-b057806a6ad7618b10db062bf6c71d09f71ce421.zip
busybox-b057806a6ad7618b10db062bf6c71d09f71ce421.tar.gz
hush: add TODO for "set -e"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 8223cdb..89cd47d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -49,6 +49,7 @@
* [un]alias, command, fc, getopts, newgrp, readonly, times
* make complex ${var%...} constructs support optional
* make here documents optional
+ * set -e (some ash testsuite entries use it, want to adopt those)
*
* Bash compat TODO:
* redirection of stdout+stderr: &> and >&
@@ -8421,6 +8422,22 @@ static int set_mode(int state, char mode, const char *o_opt)
G.o_opt[idx] = state;
break;
}
+/* TODO: set -e
+Exit if pipe, list, or compound command exits with a non-zero status.
+Shell does not exit if failed command is part of condition in
+if/while, part of && or || list except the last command, any command
+in a pipe but the last, or if the command's return value is being
+inverted with !. If a compound command other than a subshell returns a
+non-zero status because a command failed while -e was being ignored, the
+shell does not exit. A trap on ERR, if set, is executed before the shell
+exits [ERR is a bashism].
+
+If a compound command or function executes in a context where -e is
+ignored, none of the commands executed within are affected by the -e
+setting. If a compound command or function sets -e while executing in a
+context where -e is ignored, that setting does not have any effect until
+the compound command or the command containing the function call completes.
+*/
default:
return EXIT_FAILURE;
}