diff options
author | jilles <jilles@FreeBSD.org> | 2016-01-30 20:10:20 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2016-01-30 20:10:20 +0000 |
commit | 365b605737d46eaff10439e6236e87a2d102cdb8 (patch) | |
tree | 3f28ba69c3e1c56793d801d3bad47c71d6cb5e18 /bin/sh/sh.1 | |
parent | 9302898500113c6f03e1967407d1b0d5699f3789 (diff) | |
download | FreeBSD-src-365b605737d46eaff10439e6236e87a2d102cdb8.zip FreeBSD-src-365b605737d46eaff10439e6236e87a2d102cdb8.tar.gz |
sh(1): Document 'cd -'.
This reflects the changes in r294649 and can therefore not be MFCed by
itself.
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r-- | bin/sh/sh.1 | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 14ae898..9406779 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 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 shells. 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. |