1write(1) User Commands write(1)
2
3
4
6 write - write to another user
7
9 write user [terminal]
10
11
13 The write utility reads lines from the user's standard input and writes
14 them to the terminal of another user. When first invoked, it writes the
15 message:
16
17 Message from sender-login-id (sending-terminal) [date]...
18
19
20
21
22 to user. When it has successfully completed the connection, the
23 sender's terminal will be alerted twice to indicate that what the
24 sender is typing is being written to the recipient's terminal.
25
26
27 If the recipient wants to reply, this can be accomplished by typing
28
29 write sender-login-id [sending-terminal]
30
31
32
33
34 upon receipt of the initial message. Whenever a line of input as delim‐
35 ited by a NL, EOF, or EOL special character is accumulated while in
36 canonical input mode, the accumulated data will be written on the other
37 user's terminal. Characters are processed as follows:
38
39 o Typing the alert character will write the alert character to
40 the recipient's terminal.
41
42 o Typing the erase and kill characters will affect the
43 sender's terminal in the manner described by the termios(3C)
44 interface.
45
46 o Typing the interrupt or end-of-file characters will cause
47 write to write an appropriate message (EOT\n in the C
48 locale) to the recipient's terminal and exit.
49
50 o Typing characters from LC_CTYPE classifications print or
51 space will cause those characters to be sent to the recipi‐
52 ent's terminal.
53
54 o When and only when the stty iexten local mode is enabled,
55 additional special control characters and multi-byte or sin‐
56 gle-byte characters are processed as printable characters if
57 their wide character equivalents are printable.
58
59 o Typing other non-printable characters will cause them to be
60 written to the recipient's terminal as follows: control
61 characters will appear as a `^' followed by the appropriate
62 ASCII character, and characters with the high-order bit set
63 will appear in "meta" notation. For example, `\003' is dis‐
64 played as `^C' and `\372' as `M−z'.
65
66
67 To write to a user who is logged in more than once, the terminal argu‐
68 ment can be used to indicate which terminal to write to. Otherwise, the
69 recipient's terminal is the first writable instance of the user found
70 in /usr/adm/utmpx, and the following informational message will be
71 written to the sender's standard output, indicating which terminal was
72 chosen:
73
74 user is logged on more than one place.
75 You are connected to terminal.
76 Other locations are:terminal
77
78
79
80
81 Permission to be a recipient of a write message can be denied or
82 granted by use of the mesg utility. However, a user's privilege may
83 further constrain the domain of accessibility of other users' termi‐
84 nals. The write utility will fail when the user lacks the appropriate
85 privileges to perform the requested action.
86
87
88 If the character ! is found at the beginning of a line, write calls the
89 shell to execute the rest of the line as a command.
90
91
92 write runs setgid() (see setuid(2)) to the group ID tty, in order to
93 have write permissions on other users' terminals.
94
95
96 The following protocol is suggested for using write: when you first
97 write to another user, wait for them to write back before starting to
98 send. Each person should end a message with a distinctive signal (that
99 is, (o) for over) so that the other person knows when to reply. The
100 signal (oo) (for over and out) is suggested when conversation is to be
101 terminated.
102
104 The following operands are supported:
105
106 user User (login) name of the person to whom the message will be
107 written. This operand must be of the form returned by the
108 who(1) utility.
109
110
111 terminal Terminal identification in the same format provided by the
112 who utility.
113
114
116 See environ(5) for descriptions of the following environment variables
117 that affect the execution of write: LANG, LC_ALL, LC_CTYPE, LC_MES‐
118 SAGES, and NLSPATH.
119
121 The following exit values are returned:
122
123 0 Successful completion.
124
125
126 >0 The addressed user is not logged on or the addressed user denies
127 permission.
128
129
131 /var/adm/utmpx User and accounting information for write
132
133
134 /usr/bin/sh Bourne shell executable file
135
136
138 See attributes(5) for descriptions of the following attributes:
139
140
141
142
143 ┌─────────────────────────────┬─────────────────────────────┐
144 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
145 ├─────────────────────────────┼─────────────────────────────┤
146 │Availability │SUNWcsu │
147 ├─────────────────────────────┼─────────────────────────────┤
148 │CSI │Enabled │
149 ├─────────────────────────────┼─────────────────────────────┤
150 │Interface Stability │Committed │
151 ├─────────────────────────────┼─────────────────────────────┤
152 │Standard │See standards(5). │
153 └─────────────────────────────┴─────────────────────────────┘
154
156 mail(1), mesg(1), pr(1), sh(1), talk(1), who(1), setuid(2),
157 termios(3C), attributes(5), environ(5), standards(5)
158
160 user is not logged on
161
162 The person you are trying to write to is not logged on.
163
164
165 Permission denied
166
167 The person you are trying to write to denies that permission (with
168 mesg).
169
170
171 Warning: cannot respond, set mesg-y
172
173 Your terminal is set to mesg n and the recipient cannot respond to
174 you.
175
176
177 Can no longer write to user
178
179 The recipient has denied permission (mesg n) after you had started
180 writing.
181
182
183
184
185SunOS 5.11 3 Nov 2000 write(1)