write(1)
NAME
write − interactively write (talk) to another user
SYNOPSIS
write user [line]
DESCRIPTION
write copies lines from your terminal to that of another user. When first called, it sends the message:
Message from yourname (tty??) [date] ...
to the person you want to talk to. 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.
The recipient of the message should write back at this point. Communication continues until an end of file is read from the terminal, an interrupt is sent, or the recipient has executed mesgn. At that point write writes EOT on the other terminal and exits.
If you want to write to a user who is logged in more than once, the line argument can be used 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 posted:
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 by use of 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 shell 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 them 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. The signal (oo) (for “over and out”) could be used when conversation is to be terminated.
EXTERNAL INFLUENCES
Environment Variables
LC_TIME determines the format and contents of date and time strings.
If LC_TIME is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. 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 person you are trying to write to is not logged on.
Permission denied
The person you are trying to write to denies that permission (with mesg).
Warning: cannot respond, set mesg -y
Your terminal is set to mesg n and the recipient cannot respond to you.
Can no longer write to user
The recipient has denied permission (mesg n) after you had started writing.
EXAMPLES
By issuing the command:
write matthew
linda sends a message to matthew’s screen. If matthew types write linda, two-way communication between matthew and linda is established.
FILES
/etc/utmp to find user
/bin/sh to execute !
SEE ALSO
elm(1), mail(1), mailx(1), mesg(1), nroff(1), pr(1), sh(1), who(1).
STANDARDS CONFORMANCE
write: SVID2, XPG2, XPG3
Hewlett-Packard Company — HP-UX Release 9.0: August 1992