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

 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]...

to user_name. When it has successfully completed the connection, the sender's terminal will be alerted twice to indicate that what the sender is typing is being written to the recipient's terminal.

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, General Terminal Interface  ) is accumulated while in canonical input mode, the accumulated data will be written on the other user's terminal. Characters are processed as follows:

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:
user_name
Login name of the person to whom the message will be written. This operand must be of the form returned by the who utility.
terminal
Terminal identification in the same format provided by the who utility.

 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 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 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:
0
Successful completion.
>0
The addressed user is not logged on or the addressed user denies permission.

 CONSEQUENCES OF ERRORS

Default.

 APPLICATION USAGE

The talk 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, talk, who, the XBD specification, General Terminal Interface  .

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