write - interactively write (talk) to another user
write user [terminal]
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
Communication continues until an end of file is read from the
terminal, an interrupt is sent, or the recipient 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 terminal 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:
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-
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
Hewlett-Packard Company - 1 - HP-UX Release 11i: November 2000
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.
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".
International Code Set Support
Single- and multi-byte character code sets are supported.
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.
Your correspondent sent end-of-file, or you set your terminal to
mesg n and your correspondent tried to write to you. If you have
a write session established, you can continue to write to your
The user you are trying to write to has denied write permission
(with mesg n).
Warning: You have your terminal set to "mesg -n". No reply possible.
Your terminal is set to mesg n and the recipient cannot respond
By issuing the command:
Hewlett-Packard Company - 2 - HP-UX Release 11i: November 2000
user linda sends a message to user matthew's screen. If matthew
two-way communication between matthew and linda is established.
/etc/utmp To find user
/usr/bin/sh To execute ! shell commands
elm(1), mail(1), mailx(1), mesg(1), nroff(1), pr(1), sh(1), who(1).
write: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
Hewlett-Packard Company - 3 - HP-UX Release 11i: November 2000