MESG(1P)
π hey bestie, this is the mesg page MESG(1P) from the POSIX Programmer's Manual π
π«Ά PROLOG
ok so real talk first β this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so go peek at the matching Linux manual page for the tea on Linux behavior), or honestly the interface might not even be implemented on Linux at all. π
β¨ NAME β¨
mesg β permit or deny messages π
π SYNOPSIS π
mesg [y|n]
π DESCRIPTION π
okay so here's the vibe: the mesg utility shall control whether other users are allowed to send messages via write, talk, or other utilities to a terminal device. π¨
The terminal device affected shall be determined by searching for the first terminal in the sequence of devices associated with standard input, standard output, and standard error, respectively. (So it's checking them in that order, first one that's a terminal wins, periodt.)
With no arguments, mesg shall report the current state without changing it. π
Processes with appropriate privileges may be able to send messages to the terminal independent of the current state. (iykyk β some people just have the power. π)
β OPTIONS β
None. literally none. she has no flags, she's working with pure operand energy. π
πΈ OPERANDS πΈ
The following operands shall be supported in the POSIX locale:
yβ Grant permission to other users to send messages to the terminal device. β open for business bestienβ Deny permission to other users to send messages to the terminal device. β do not disturb mode
π¦ STDIN π¦
Not used. she doesn't want your input, she's not that kind of girl. π
π INPUT FILES π
None.
π ENVIRONMENT VARIABLES π
The following environment variables shall affect the execution of mesg:
LANGβ Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ If set to a non-empty string value, override the values of all the other internationalization variables. (she overrides. main character energy fr fr.)LC_CTYPEβ Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ Determine the locale that should be used to affect the format and contents of diagnostic messages written (bymesg) to standard error.NLSPATHβ Determine the location of message catalogs for the processing ofLC_MESSAGES.
π§ ASYNCHRONOUS EVENTS π§
Default.
β¨ STDOUT β¨
If no operand is specified, mesg shall display the current terminal state in an unspecified format. (so like. don't try to parse it. it's giving mysterious. π«§)
π STDERR π
The standard error shall be used only for diagnostic messages.
π OUTPUT FILES π
None.
π EXTENDED DESCRIPTION π
None. nothing extra, she said what she said.
π₯ EXIT STATUS π₯
The following exit values shall be returned:
0β Receiving messages is allowed. π1β Receiving messages is not allowed. π«>1β An error occurred. π
π CONSEQUENCES OF ERRORS π
Default.
The following sections are informative. (so it's lore, not law. π)
π«Ά APPLICATION USAGE π«Ά
The mechanism by which the message status of the terminal is changed is unspecified. So like β unspecified actions may cause the status of the terminal to change after mesg has successfully completed. π³
These actions may include, but are not limited to:
- another invocation of the
mesgutility - login procedures
- invocation of the
sttyutility - invocation of the
chmodutility orchmod()function - and so on.
so yeah, other things can absolutely come for her crown. watch out. π
π EXAMPLES π
None.
π RATIONALE π
okay so the lore drop:
The terminal changed by mesg is that associated with the standard input, output, or error, rather than the controlling terminal for the session. Why? Because users logged in more than once should be able to change any of their login terminals without having to stop the job running in those sessions. π₯οΈβ¨
This is not a security problem involving the terminals of other users because appropriate privileges would be required to affect the terminal of another user. (so like, chill, it's safe.)
The method of checking each of the first three file descriptors in sequence until a terminal is found was adopted from System V.
The file /dev/tty is not specified for the terminal device because it was thought to be too restrictive. Typical environment changes for the n operand are that write permissions are removed for others and group from the appropriate device. It was decided to leave the actual description of what is done as unspecified because of potential differences between implementations.
The format for standard output is unspecified because of differences between historical implementations. This output is generally not useful to shell scripts (they can use the exit status), so exact parsing of the output is unnecessary. π
β FUTURE DIRECTIONS β
None.
π¦ SEE ALSO π¦
talk, write
The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page bestie!! πβ¨ this one came from IEEE/The Open Group, dated 2017, and it's the MESG(1P) page β ty for reading, ily, go set your terminal to n if you need a nap ππ¦πΈ
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms