]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
environ.7: Improve the description of PATH
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 30 Jan 2021 07:36:08 +0000 (08:36 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 30 Jan 2021 07:36:08 +0000 (08:36 +0100)
Add more details of how PATH is used, and mention the legacy
use of an empty prefix.

Changed after a suggested patch by Bastien Roucariès.

Reported-by: Bastien Roucariès <rouca@debian.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/environ.7

index dd35050b2540d823d3b38a0020d841de64ec4c2f..11dfb48629a9235509d0ae93c112f647213e3303 100644 (file)
@@ -98,8 +98,22 @@ The sequence of directory prefixes that
 .BR sh (1)
 and many other
 programs employ when searching for an executable file that is specified
-as a simple filename (containing no slashes).
-The prefixes are separated by \(aq\fB:\fP\(aq.
+as a simple filename (i.a., a pathname that contains no slashes).
+The prefixes are separated by colons (\fB:\fP).
+The list of prefixes is searched from beginning to end,
+by checking the pathname formed by concatenating
+a prefix, a slash, and the filename,
+until a file with execute permission is found.
+.IP
+As a legacy feature, a zero-length prefix
+(specified as two adjacent colons, or an initial or terminating colon)
+is interpreted to mean the current working directory.
+However, use of this feature is deprecated,
+and POSIX notes that a conforming application shall use
+an explicit pathname (e.g.,
+.IR . )
+to specify the current working directory.
+.IP
 (Similarly one has
 .B CDPATH
 used by some shells to find the target