summaryrefslogtreecommitdiffstats
path: root/bin/sh/sh.1
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-05-20 22:55:18 +0000
committerjilles <jilles@FreeBSD.org>2011-05-20 22:55:18 +0000
commit8c45da6d46639aaf96d62dfaeda1511092a07ee0 (patch)
tree2b9c2b64063550fe3099663eac19df6a627b0bf0 /bin/sh/sh.1
parentb1c7404a29cca0fe879d99c3022eef64cb1a8017 (diff)
downloadFreeBSD-src-8c45da6d46639aaf96d62dfaeda1511092a07ee0.zip
FreeBSD-src-8c45da6d46639aaf96d62dfaeda1511092a07ee0.tar.gz
sh: Implement the cd -e flag proposed for the next POSIX issue.
This reflects failure to determine the pathname of the new directory in the exit status (1). Normally, cd returns successfully if it did chdir() and the call was successful. In POSIX, -e only has meaning with -P; because our -L is not entirely compliant and may fall back to -P mode, -e has some effect with -L as well.
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r--bin/sh/sh.113
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 838cafe..a74e677 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd May 8, 2011
+.Dd May 20, 2011
.Dt SH 1
.Os
.Sh NAME
@@ -1729,7 +1729,7 @@ Execute the specified built-in command,
.Ar cmd .
This is useful when the user wishes to override a shell function
with the same name as a built-in command.
-.It Ic cd Oo Fl L | P Oc Op Ar directory
+.It Ic cd Oo Fl L | P Oc Oo Fl e Oc Op Ar directory
Switch to the specified
.Ar directory ,
or to the directory specified in the
@@ -1778,6 +1778,15 @@ option is specified,
.Pa ..
is handled logically.
This is the default.
+.Pp
+The
+.Fl e
+option causes
+.Ic cd
+to return exit status 1 if the full pathname of the new directory
+cannot be determined reliably or at all.
+Normally this is not considered an error,
+although a warning is printed.
.It Ic chdir
A synonym for the
.Ic cd
OpenPOWER on IntegriCloud