1MESG(1P) POSIX Programmer's Manual MESG(1P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 mesg — permit or deny messages
14
16 mesg [y|n]
17
19 The mesg utility shall control whether other users are allowed to send
20 messages via write, talk, or other utilities to a terminal device. The
21 terminal device affected shall be determined by searching for the first
22 terminal in the sequence of devices associated with standard input,
23 standard output, and standard error, respectively. With no arguments,
24 mesg shall report the current state without changing it. Processes with
25 appropriate privileges may be able to send messages to the terminal
26 independent of the current state.
27
29 None.
30
32 The following operands shall be supported in the POSIX locale:
33
34 y Grant permission to other users to send messages to the ter‐
35 minal device.
36
37 n Deny permission to other users to send messages to the termi‐
38 nal device.
39
41 Not used.
42
44 None.
45
47 The following environment variables shall affect the execution of mesg:
48
49 LANG Provide a default value for the internationalization vari‐
50 ables that are unset or null. (See the Base Definitions vol‐
51 ume of POSIX.1‐2008, Section 8.2, Internationalization Vari‐
52 ables for the precedence of internationalization variables
53 used to determine the values of locale categories.)
54
55 LC_ALL If set to a non-empty string value, override the values of
56 all the other internationalization variables.
57
58 LC_CTYPE Determine the locale for the interpretation of sequences of
59 bytes of text data as characters (for example, single-byte as
60 opposed to multi-byte characters in arguments).
61
62 LC_MESSAGES
63 Determine the locale that should be used to affect the format
64 and contents of diagnostic messages written (by mesg) to
65 standard error.
66
67 NLSPATH Determine the location of message catalogs for the processing
68 of LC_MESSAGES.
69
71 Default.
72
74 If no operand is specified, mesg shall display the current terminal
75 state in an unspecified format.
76
78 The standard error shall be used only for diagnostic messages.
79
81 None.
82
84 None.
85
87 The following exit values shall be returned:
88
89 0 Receiving messages is allowed.
90
91 1 Receiving messages is not allowed.
92
93 >1 An error occurred.
94
96 Default.
97
98 The following sections are informative.
99
101 The mechanism by which the message status of the terminal is changed is
102 unspecified. Therefore, unspecified actions may cause the status of the
103 terminal to change after mesg has successfully completed. These actions
104 may include, but are not limited to: another invocation of the mesg
105 utility, login procedures; invocation of the stty utility, invocation
106 of the chmod utility or chmod() function, and so on.
107
109 None.
110
112 The terminal changed by mesg is that associated with the standard
113 input, output, or error, rather than the controlling terminal for the
114 session. This is because users logged in more than once should be able
115 to change any of their login terminals without having to stop the job
116 running in those sessions. This is not a security problem involving
117 the terminals of other users because appropriate privileges would be
118 required to affect the terminal of another user.
119
120 The method of checking each of the first three file descriptors in
121 sequence until a terminal is found was adopted from System V.
122
123 The file /dev/tty is not specified for the terminal device because it
124 was thought to be too restrictive. Typical environment changes for the
125 n operand are that write permissions are removed for others and group
126 from the appropriate device. It was decided to leave the actual
127 description of what is done as unspecified because of potential differ‐
128 ences between implementations.
129
130 The format for standard output is unspecified because of differences
131 between historical implementations. This output is generally not useful
132 to shell scripts (they can use the exit status), so exact parsing of
133 the output is unnecessary.
134
136 None.
137
139 talk, write
140
141 The Base Definitions volume of POSIX.1‐2008, Chapter 8, Environment
142 Variables
143
145 Portions of this text are reprinted and reproduced in electronic form
146 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
147 -- Portable Operating System Interface (POSIX), The Open Group Base
148 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
149 cal and Electronics Engineers, Inc and The Open Group. (This is
150 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
151 event of any discrepancy between this version and the original IEEE and
152 The Open Group Standard, the original IEEE and The Open Group Standard
153 is the referee document. The original Standard can be obtained online
154 at http://www.unix.org/online.html .
155
156 Any typographical or formatting errors that appear in this page are
157 most likely to have been introduced during the conversion of the source
158 files to man page format. To report such errors, see https://www.ker‐
159 nel.org/doc/man-pages/reporting_bugs.html .
160
161
162
163IEEE/The Open Group 2013 MESG(1P)