The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

mesg - permit or deny messages

 SYNOPSIS



mesg [y|n]

 DESCRIPTION

The mesg utility will control whether other users are allowed to send messages via write, talk or other utilities to a terminal device. The terminal device affected is determined by searching for the first terminal in the sequence of devices associated with standard input, standard output and standard error, respectively. With no arguments, mesg reports the current state without changing it. Processes with appropriate privileges may be able to send messages to the terminal independent of the current state.

 OPTIONS

None.

 OPERANDS

The following operands are supported in the POSIX locale:
y
Grant permission to other users to send messages to the terminal device.
n
Deny permission to other users to send messages to the terminal device.

 STDIN

Not used.

 INPUT FILES

None.

 ENVIRONMENT VARIABLES

The following environment variables affect the execution of mesg:
LANG
Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
LC_ALL
If set to a non-empty string value, override the values of all the other internationalisation variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- 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 (by mesg) to standard error.
NLSPATH
Determine the location of message catalogues for the processing of LC_MESSAGES .

 ASYNCHRONOUS EVENTS

Default.

 STDOUT

If no operand is specified, mesg displays the current terminal state in an unspecified format.

 STDERR

Used only for diagnostic messages.

 OUTPUT FILES

None.

 EXTENDED DESCRIPTION

None.

 EXIT STATUS

The following exit values are returned:
0
Receiving messages is allowed.
1
Receiving messages is not allowed.
>1
An error occurred.

 CONSEQUENCES OF ERRORS

Default.

 APPLICATION USAGE

The mechanism by which the message status of the terminal is changed is unspecified. Therefore, 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 mesg utility; login procedures; invocation of the stty utility; invocation of the chmod utility or chmod() function; and so on.

 EXAMPLES

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

talk, write.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]