HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)

w
write(1) write(1)
NAME
write - interactively write (talk) to another user
SYNOPSIS
write user [terminal]
DESCRIPTION
The write command copies lines from your terminal to that of another user. When first called, it sends
the message:
Message from yourname (yourterminal)[date
] ...
to the receiving user’s terminal. When it has successfully completed the connection, it also sends two bells
to your own terminal to indicate that what you are typing is being sent.
To set up two-way communication, the recipient of the message (user) must execute the command:
write yourname [yourterminal]
(yourterminal is only required if the originator is logged in more than once.)
Communication continues until an end of file is read from the terminal, an interrupt is sent, or the reci-
pient executes mesg n. At that point, write writes <EOT> on the other terminal and exits.
To write to a user who is logged in more than once, use the terminal argument to indicate which line or ter-
minal to send to (e.g.,
tty00). Otherwise, the first writable instance of the user found in
/etc/utmp is
assumed and the following message is displayed:
user
is logged on more than one place.
You are connected to "
terminal".
Other locations are:
terminal
...
Permission to write may be denied or granted with the
mesg command (see mesg(1)). Writing to others is
normally allowed by default. Certain commands, in particular
nroff and pr disallow messages in order
to prevent interference with their output. However, if the user has the appropriate privileges, messages
can be forced onto a write-inhibited terminal.
If the character ! is found at the beginning of a line, write calls the Bourne shell (see sh-bourne(1)) to
execute the rest of the line as a command.
The following protocol is suggested for using
write: When you first write to another user, wait for the
user to write back before starting to send. Each person should end a message with a distinctive signal
(such as "(o)" for "over") so that the other person knows when to reply. Similarly, the signal "
(oo)" (for
"over and out") can be used to indicate the end of the conversation.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the locale to use for the locale categories when both LC_ALL and the corresponding
environment variable (beginning with LC_) do not specify a locale. If LANG is not set or is set to the
empty string, a default of "C" (see lang(5)) is used.
LC_TIME determines the format and contents of date and time strings.
LC_MESSAGES determines the language in which messages are displayed.
If any internationalization variable contains an invalid setting, write behaves as if all internationalization
variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
DIAGNOSTICS
user
is not logged on.
The user you are trying to write to is not logged on.
Can no longer write to terminal
Your correspondent has denied write permission (mesg n) after your write session started. Your
write session is ended.
HP-UX 11i Version 1: September 2005 1 Hewlett-Packard Company Section 11067