diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 38282d42c605..b8c05896f970 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -273,7 +273,8 @@ evaltree(union node *n, int flags) if (pendingsigs) dotrap(); if ((flags & EV_EXIT) || (eflag && exitstatus - && !(flags & EV_TESTED) && (n->type == NCMD))) + && !(flags & EV_TESTED) && (n->type == NCMD || + n->type == NSUBSHELL))) exitshell(exitstatus); }