svn commit: r295083 - head/bin/sh
Jilles Tjoelker
jilles at FreeBSD.org
Sat Jan 30 20:10:21 UTC 2016
Author: jilles
Date: Sat Jan 30 20:10:20 2016
New Revision: 295083
URL: https://svnweb.freebsd.org/changeset/base/295083
Log:
sh(1): Document 'cd -'.
This reflects the changes in r294649 and can therefore not be MFCed by
itself.
Modified:
head/bin/sh/sh.1
Modified: head/bin/sh/sh.1
==============================================================================
--- head/bin/sh/sh.1 Sat Jan 30 19:59:58 2016 (r295082)
+++ head/bin/sh/sh.1 Sat Jan 30 20:10:20 2016 (r295083)
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd August 29, 2015
+.Dd January 30, 2016
.Dt SH 1
.Os
.Sh NAME
@@ -1952,13 +1952,20 @@ Execute the specified built-in command,
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 Oo Fl e Oc Op Ar directory
+.It Ic cd Fl
Switch to the specified
.Ar directory ,
-or to the directory specified in the
+to the directory specified in the
.Va HOME
environment variable if no
.Ar directory
-is specified.
+is specified or
+to the directory specified in the
+.Va OLDPWD
+environment variable if
+.Ar directory
+is
+.Fl .
If
.Ar directory
does not begin with
@@ -1982,10 +1989,12 @@ the
.Ic cd
command will print out the name of the directory
that it actually switched to
-if this is different from the name that the user gave.
-These may be different either because the
+if the
.Va CDPATH
-mechanism was used or because a symbolic link was crossed.
+mechanism was used or if
+.Ar directory
+was
+.Fl .
.Pp
If the
.Fl P
@@ -2774,6 +2783,10 @@ Initialization file for interactive shel
Locale settings.
These are inherited by children of the shell,
and is used in a limited manner by the shell itself.
+.It Ev OLDPWD
+The previous current directory.
+This is used and updated by
+.Ic cd .
.It Ev PWD
An absolute pathname for the current directory,
possibly containing symbolic links.
More information about the svn-src-all
mailing list