summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1995-05-19 15:08:55 +0000
committerchristos <christos@NetBSD.org>1995-05-19 15:08:55 +0000
commit4fb6f609aa73f895cdfc4e008e00a7f0bb96499f (patch)
treea46f0aad71dd501a9d556ad9b2f10e782bece487 /bin
parentb4cf60ac8a759887f0cb18132ae67b9a5060e39b (diff)
Changed so that syntax errors (EXERROR) set the exit status to 2,
and commands that are not found set the exit status to 1 like all other bourne shells. [It used to be 0 and 2 respectively]
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/eval.c10
-rw-r--r--bin/sh/main.c8
2 files changed, 10 insertions, 8 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 53b8dd5fc56..2144c401436 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.c,v 1.24 1995/05/15 03:29:54 cgd Exp $ */
+/* $NetBSD: eval.c,v 1.25 1995/05/19 15:08:55 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -38,9 +38,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)eval.c 8.7 (Berkeley) 5/15/95";
+static char sccsid[] = "@(#)eval.c 8.8 (Berkeley) 5/19/95";
#else
-static char rcsid[] = "$NetBSD: eval.c,v 1.24 1995/05/15 03:29:54 cgd Exp $";
+static char rcsid[] = "$Header: /cvsroot/src/bin/sh/eval.c,v 1.25 1995/05/19 15:08:55 christos Exp $";
#endif
#endif /* not lint */
@@ -679,7 +679,7 @@ evalcommand(cmd, flags, backcmd)
} else {
find_command(argv[0], &cmdentry, 1);
if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */
- exitstatus = 2;
+ exitstatus = 1;
flushout(&errout);
return;
}
@@ -691,7 +691,7 @@ evalcommand(cmd, flags, backcmd)
break;
if ((cmdentry.u.index = find_builtin(*argv)) < 0) {
outfmt(&errout, "%s: not found\n", *argv);
- exitstatus = 2;
+ exitstatus = 1;
flushout(&errout);
return;
}
diff --git a/bin/sh/main.c b/bin/sh/main.c
index 3407f6c9fac..023e22d2ef5 100644
--- a/bin/sh/main.c
+++ b/bin/sh/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.18 1995/05/11 21:29:25 christos Exp $ */
+/* $NetBSD: main.c,v 1.19 1995/05/19 15:08:58 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -44,9 +44,9 @@ static char copyright[] =
#ifndef lint
#if 0
-static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)main.c 8.5 (Berkeley) 5/19/95";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.18 1995/05/11 21:29:25 christos Exp $";
+static char rcsid[] = "$Header: /cvsroot/src/bin/sh/main.c,v 1.19 1995/05/19 15:08:58 christos Exp $";
#endif
#endif /* not lint */
@@ -119,6 +119,8 @@ main(argc, argv)
* exception EXSHELLPROC to clean up before executing
* the shell procedure.
*/
+ if (exception == EXERROR)
+ exitstatus = 2;
if (exception == EXSHELLPROC) {
rootpid = getpid();
rootshell = 1;