write(1) write(1)
NAME [Toc] [Back]
write - interactively write (talk) to another user
SYNOPSIS [Toc] [Back]
write user [terminal]
DESCRIPTION [Toc] [Back]
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 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 utmps
database 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 writeinhibited
terminal.
If the character ! is found at the beginning of a line, write calls
the POSIX shell (see sh-posix(1)) to execute the rest of the line as a
command.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
write(1) write(1)
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 [Toc] [Back]
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 [Toc] [Back]
Single- and multi-byte character code sets are supported.
DIAGNOSTICS [Toc] [Back]
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.
<EOT>
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
correspondent.
Permission denied. [Toc] [Back]
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
to you.
EXAMPLES [Toc] [Back]
By issuing the command:
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
write(1) write(1)
write matthew
user linda sends a message to user matthew's screen. If matthew
responds:
write linda
two-way communication between matthew and linda is established.
FILES [Toc] [Back]
utmps database To find user
/usr/bin/sh To execute ! shell commands
SEE ALSO [Toc] [Back]
elm(1), mail(1), mailx(1), mesg(1), nroff(1), pr(1), sh-posix(1),
sh(1), who(1), utmpd(1M), getutsent(3C).
STANDARDS CONFORMANCE [Toc] [Back]
write: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003 [ Back ] |