NAME
write — write to
another user
SYNOPSIS
write |
user_name [terminal] |
DESCRIPTION
The write utility reads lines from the
user's standard input and writes them to the terminal of another user. When
first invoked, it writes the message:
Message from sender-login-id (sending-terminal) [date]...
If the recipient wants to reply, this can be accomplished
by typing: write sender-login-id [sending-terminal]
upon receipt of the initial message. Whenever a line of input as delimited
by a NL, EOF or EOL special character (see the
XBD specification,
termios(7) ) is accumulated while in canonical input mode,
the accumulated data will be written on the other user's terminal.
Characters are processed as follows:
- Typing the alert character will write the alert character to the recipient's terminal.
- Typing the erase and kill characters will affect the sender's terminal in the manner described by the termios interface in the XBD specification, General Terminal Interface .
- Typing the interrupt or end-of-file characters will cause
writeto write an appropriate message (EOT\n in the POSIX locale) to the recipient's terminal and exit. - Typing characters from LC_CTYPE classifications print or space will cause those characters to be sent to the recipient's terminal.
- When and only when the stty(1) iexten local mode is enabled, the existence and processing of additional special control characters and multi-byte or single-byte functions is implementation-dependent.
- Typing other non-printable characters will cause implementation-dependent sequences of printable characters to be written to the recipient's terminal.
To write to a user who is logged in more than once, the terminal argument can be used to indicate which terminal to write to; otherwise, the recipient's terminal is selected in an implementation-dependent manner and an informational message will be written to the sender's standard output, indicating which terminal was chosen.
Permission to be a recipient of a
write message can be denied or granted by use of the
mesg utility.
However, a user's privilege may further constrain the domain of
accessibility of other users' terminals. The write
utility will fail when the user lacks the appropriate privileges to perform
the requested action.
OPTIONS
None.
OPERANDS
The following operands are supported:
STDIN
Lines to be copied to the recipient's terminal will be read from standard input.
INPUT FILES
None.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of
write :
LANG- Provide a default value for the internationalisation variables that are
unset or null. If
LANGis 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 and input files). If the recipient's locale does not use an LC_CTYPE equivalent to the sender's, the results are undefined.
LC_MESSAGES- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output.
NLSPATH- Determine the location of message catalogues for the processing of LC_MESSAGES .
ASYNCHRONOUS EVENTS
If an interrupt signal is received, write
will write an appropriate message on the recipient's terminal and exit with
a status of zero. It will take the standard action for all other
signals.
STDOUT
An informational message will be written to standard output if a recipient is logged in more than once.
STDERR
Used only for diagnostic messages.
OUTPUT FILES
The recipient's terminal will be used for output.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The following exit values are returned:
CONSEQUENCES OF ERRORS
Default.
APPLICATION USAGE
The talk(1) utility is considered by some users to be a more usable utility on full-screen terminals.
EXAMPLES
None.
FUTURE DIRECTIONS
The IEEE PASC 1003.2 Interpretations Committee has forwarded concerns about parts of this interface definition to the IEEE PASC Shell and Utilities Working Group which is identifying the corrections. A future revision of this specification will align with IEEE Std. 1003.2b when finalised.
SEE ALSO
mesg(1) , talk(1) , who(1) , the XBD specification, General Terminal Interface .