Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (k - l) logname(1)
NAME
logname - Displays user login name
SYNOPSIS
logname
DESCRIPTION
The logname command writes to the standard output le the name you used to log in to the sys-
tem. This name is returned by the getlogin() function. Under conditions where getlogin()
would fail, the logname command writes a diagnostic message to the standard error le and exits
with a nonzero exit value.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and
NLSPATH environment variables.
EXIT VALUES
The logname command returns the following values:
0 (zero) The command completed successfully.
>0 An error occurred.
RELATED INFORMATION
Commands: env(1).
Functions: getlogin(2).
STANDARDS CONFORMANCE
This command conforms to the XPG4 Version 2 specication with extensions.
527188-003 Hewlett-Packard Company 569