1LOGNAME(P)                 POSIX Programmer's Manual                LOGNAME(P)
2
3
4

NAME

6       logname - return the user's login name
7

SYNOPSIS

9       logname
10

DESCRIPTION

12       The  logname utility shall write the user's login name to standard out‐
13       put. The login name shall be the string that would be returned  by  the
14       getlogin()   function  defined  in  the  System  Interfaces  volume  of
15       IEEE Std 1003.1-2001. Under the conditions where the  getlogin()  func‐
16       tion  would  fail, the logname utility shall write a diagnostic message
17       to standard error and exit with a non-zero exit status.
18

OPTIONS

20       None.
21

OPERANDS

23       None.
24

STDIN

26       Not used.
27

INPUT FILES

29       None.
30

ENVIRONMENT VARIABLES

32       The following environment variables shall affect the execution of  log‐
33       name:
34
35       LANG   Provide  a  default value for the internationalization variables
36              that are unset or null. (See  the  Base  Definitions  volume  of
37              IEEE Std 1003.1-2001,  Section  8.2,  Internationalization Vari‐
38              ables for the precedence of internationalization variables  used
39              to determine the values of locale categories.)
40
41       LC_ALL If  set  to a non-empty string value, override the values of all
42              the other internationalization variables.
43
44       LC_CTYPE
45              Determine the locale for  the  interpretation  of  sequences  of
46              bytes  of  text  data as characters (for example, single-byte as
47              opposed to multi-byte characters in arguments).
48
49       LC_MESSAGES
50              Determine the locale that should be used to  affect  the  format
51              and contents of diagnostic messages written to standard error.
52
53       NLSPATH
54              Determine the location of message catalogs for the processing of
55              LC_MESSAGES .
56
57

ASYNCHRONOUS EVENTS

59       Default.
60

STDOUT

62       The logname utility output shall be a single  line  consisting  of  the
63       user's login name:
64
65
66              "%s\n", <login name>
67

STDERR

69       The standard error shall be used only for diagnostic messages.
70

OUTPUT FILES

72       None.
73

EXTENDED DESCRIPTION

75       None.
76

EXIT STATUS

78       The following exit values shall be returned:
79
80        0     Successful completion.
81
82       >0     An error occurred.
83
84

CONSEQUENCES OF ERRORS

86       Default.
87
88       The following sections are informative.
89

APPLICATION USAGE

91       The logname utility explicitly ignores the LOGNAME environment variable
92       because environment changes could produce erroneous results.
93

EXAMPLES

95       None.
96

RATIONALE

98       The passwd file is not listed as required  because  the  implementation
99       may have other means of mapping login names.
100

FUTURE DIRECTIONS

102       None.
103

SEE ALSO

105       id , who , the System Interfaces volume of IEEE Std 1003.1-2001, getlo‐
106       gin()
107
109       Portions of this text are reprinted and reproduced in  electronic  form
110       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
111       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
112       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
113       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
114       event of any discrepancy between this version and the original IEEE and
115       The Open Group Standard, the original IEEE and The Open Group  Standard
116       is  the  referee document. The original Standard can be obtained online
117       at http://www.opengroup.org/unix/online.html .
118
119
120
121IEEE/The Open Group                  2003                           LOGNAME(P)
Impressum