2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\" This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH WRITE 1 "Nov 3, 2000"
14 write \- write to another user
18 \fBwrite\fR \fIuser\fR [\fIterminal\fR]
24 The \fBwrite\fR utility reads lines from the user's standard input and writes
25 them to the terminal of another user. When first invoked, it writes the
30 Message from \fIsender-login-id\fR (\fIsending-terminal\fR) [date]...
37 to \fIuser\fR. When it has successfully completed the connection, the sender's
38 terminal will be alerted twice to indicate that what the sender is typing is
39 being written to the recipient's terminal.
42 If the recipient wants to reply, this can be accomplished by typing
46 write \fIsender-login-id\fR [\fIsending-terminal\fR]
53 upon receipt of the initial message. Whenever a line of input as delimited by a
54 \fBNL\fR, \fBEOF\fR, or \fBEOL\fR special character is accumulated while in
55 canonical input mode, the accumulated data will be written on the other user's
56 terminal. Characters are processed as follows:
61 Typing the alert character will write the alert character to the recipient's
68 Typing the erase and kill characters will affect the sender's terminal in the
69 manner described by the \fBtermios\fR(3C) interface.
75 Typing the interrupt or end-of-file characters will cause \fBwrite\fR to write
76 an appropriate message (EOT\en in the C locale) to the recipient's terminal and
83 Typing characters from \fBLC_CTYPE\fR classifications \fBprint\fR or
84 \fBspace\fR will cause those characters to be sent to the recipient's terminal.
90 When and only when the \fBstty\fR \fBiexten\fR local mode is enabled,
91 additional special control characters and multi-byte or single-byte characters
92 are processed as printable characters if their wide character equivalents are
99 Typing other non-printable characters will cause them to be written to the
100 recipient's terminal as follows: control characters will appear as a `\fB^\fR'
101 followed by the appropriate \fBASCII\fR character, and characters with the
102 high-order bit set will appear in "meta" notation. For example, `\fB\e003\fR\&'
103 is displayed as `\fB^C\fR' and `\fB\e372\fR\&' as `\fBM\(miz\fR'.
107 To write to a user who is logged in more than once, the \fIterminal\fR argument
108 can be used to indicate which terminal to write to. Otherwise, the recipient's
109 terminal is the first writable instance of the user found in
110 \fB/usr/adm/utmpx\fR, and the following informational message will be written
111 to the sender's standard output, indicating which terminal was chosen:
115 \fIuser\fR is logged on more than one place.
116 You are connected to \fIterminal\fR.
117 Other locations are:\fIterminal\fR
124 Permission to be a recipient of a \fBwrite\fR message can be denied or granted
125 by use of the \fBmesg\fR utility. However, a user's privilege may further
126 constrain the domain of accessibility of other users' terminals. The
127 \fBwrite\fR utility will fail when the user lacks the appropriate privileges to
128 perform the requested action.
131 If the character \fB!\fR is found at the beginning of a line, \fBwrite\fR calls
132 the shell to execute the rest of the line as a command.
135 \fBwrite\fR runs \fBsetgid()\fR (see \fBsetuid\fR(2)) to the group \fBID\fR
136 \fBtty\fR, in order to have write permissions on other users' terminals.
139 The following protocol is suggested for using \fBwrite\fR: when you first
140 \fBwrite\fR to another user, wait for them to \fBwrite\fR back before starting
141 to send. Each person should end a message with a distinctive signal (that is,
142 \fB(o)\fR for \fIover\fR) so that the other person knows when to reply. The
143 signal \fB(oo)\fR (for \fBover and out\fR) is suggested when conversation is to
148 The following operands are supported:
155 User (login) name of the person to whom the message will be written. This
156 operand must be of the form returned by the \fBwho\fR(1) utility.
165 Terminal identification in the same format provided by the \fBwho\fR utility.
168 .SH ENVIRONMENT VARIABLES
171 See \fBenviron\fR(5) for descriptions of the following environment variables
172 that affect the execution of \fBwrite\fR: \fBLANG\fR, \fBLC_ALL\fR,
173 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
177 The following exit values are returned:
184 Successful completion.
193 The addressed user is not logged on or the addressed user denies permission.
200 \fB\fB/var/adm/utmpx\fR\fR
203 User and accounting information for \fBwrite\fR
209 \fB\fB/usr/bin/sh\fR\fR
212 Bourne shell executable file
218 See \fBattributes\fR(5) for descriptions of the following attributes:
226 ATTRIBUTE TYPE ATTRIBUTE VALUE
230 Interface Stability Committed
232 Standard See \fBstandards\fR(5).
238 \fBmail\fR(1), \fBmesg\fR(1), \fBpr\fR(1), \fBsh\fR(1), \fBtalk\fR(1),
239 \fBwho\fR(1), \fBsetuid\fR(2), \fBtermios\fR(3C), \fBattributes\fR(5),
240 \fBenviron\fR(5), \fBstandards\fR(5)
245 \fB\fBuser is not logged on\fR\fR
249 The person you are trying to \fBwrite\fR to is not logged on.
255 \fB\fBPermission denied\fR\fR
259 The person you are trying to \fBwrite\fR to denies that permission (with
266 \fB\fBWarning: cannot respond, set mesg\fR\fB-y\fR\fR
270 Your terminal is set to \fBmesg\fR \fBn\fR and the recipient cannot respond to
277 \fB\fBCan no longer write to user\fR\fR
281 The recipient has denied permission (\fBmesg n\fR) after you had started