August 1999
Intermediate to advanced
1000 pages
83h 9m
English
/usr/bin/logname
The logname command writes your login name to standard output as shown in the following example.
castle% logname
winsor
castle% The login name is the string returned by the getlogin(3C) function. Under the conditions where getlogin() would fail, logname writes a diagnostic message to standard error and exits with a non-zero exit status.
See environ(5) for descriptions of the following environment variables that affect the execution of logname: LC_CTYPE, LC_MESSAGES, and NLSPATH.
| 0 | Successful completion. |
| >0 | An error occurred. |
| /etc/profile | Environment for user at login time. |
| /var/adm/utmp | User and accounting information. ... |
Read now
Unlock full access