aboutsummaryrefslogtreecommitdiff
path: root/bin/sh
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-10-01 11:48:18 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-10-01 11:48:18 +0000
commit8c395729973a319b7ea5ffb578a30ce4c97cf667 (patch)
tree9e6cb9cbac3e6a408353de462840c8f1886fe8c1 /bin/sh
parent0c1661b754558c9017e31b862e4b4c01e7f1cb1f (diff)
Notes
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/exec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index d70d03e53c73..21f247f4557b 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -144,6 +144,8 @@ shellexec(char **argv, char **envp, char *path, int index)
exerrno = 2;
break;
}
+ if (e == ENOENT || e == ENOTDIR)
+ exerror(EXEXEC, "%s: not found", argv[0]);
exerror(EXEXEC, "%s: %s", argv[0], strerror(e));
}
@@ -419,8 +421,12 @@ loop:
/* We failed. If there was an entry for this command, delete it */
if (cmdp)
delete_cmd_entry();
- if (printerr)
- outfmt(out2, "%s: %s\n", name, strerror(e));
+ if (printerr) {
+ if (e == ENOENT || e == ENOTDIR)
+ outfmt(out2, "%s: not found\n", name);
+ else
+ outfmt(out2, "%s: %s\n", name, strerror(e));
+ }
entry->cmdtype = CMDUNKNOWN;
return;