NAME
pwd — return
working directory name
SYNOPSIS
pwd |
DESCRIPTION
The pwd utility shall write an absolute
pathname of the current working directory to standard output.
OPTIONS
None.
OPERANDS
None.
STANDARD INPUT
None.
INPUT FILES
None.
ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of
pwd:
LANG-
This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_ ) do not specify a locale. See 2.6.
LC_ALL-
This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_.
LC_MESSAGES-
This variable shall determine the language in which messages should be written.
ASYNCHRONOUS EVENTS
Default.
STANDARD OUTPUT
The pwd utility output shall be an
absolute pathname of the current working directory: "%s\n",
<directory pathname>
STANDARD ERROR
Used only for diagnostic messages.
OUTPUT FILES
None.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The pwd utility shall exit with one of the
following values:
CONSEQUENCES OF ERRORS
If an error is detected, output shall not be written to standard output, a diagnostic message shall be written to standard error, and the exit status shall not be zero.
RATIONALE
EXAMPLES
Some implementations have historically provided
pwd as a shell special built-in command.
HISTORY OF DECISIONS MADE
In most utilities, if an error occurs, partial output may be
written to standard output. This does not happen in historical
implementations of pwd. Because
pwd is frequently used in existing shell scripts
without checking the exit status, it is important that the historical
behavior is required here; therefore, the Consequences of Errors subclause
specifically disallows any partial output being written to standard
output.