User Commands logname(1) NAME logname - return user's login name SYNOPSIS /usr/bin/logname /usr/bin/logname [ options ] ksh93 logname [ options ] DESCRIPTION logname writes the users's login name to standard output. The login name is the string that is returned by the getlogin(2) function. If getlogin(2) does not return successfully, the corresponding to the real user id of the calling process is used instead. OPTIONS The following option is supported: --man, --html, --nroff Prints builtin manual page in either plain text, HTML or nroff format. --help Prints basic help information --version Prints version information ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of logname: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS The following error values are returned: 0 Successful completion. >0 An error occurred. FILES /etc/profile environment for user at login time /var/adm/utmpx user and accounting information ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| This command conforms to IEEE Std 1003.1-2008. SEE ALSO env(1), ksh93(1), login(1), getlogin(3C), utmpx(4), attributes(5), environ(5), standards(5), http://www.opengroup.org/onlinepubs/9699919799/utilities/logname.html SunOS 5.10 Last change: 3 Nov 2000 2