strmode doesn't allocate space anymore, just use the stack
[unix-history] / usr / src / usr.bin / write / write.1
CommitLineData
c213cedf
KB
1.\" Copyright (c) 1989 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Jef Poskanzer and Craig Leres of the Lawrence Berkeley Laboratory.
6.\"
7.\" Redistribution and use in source and binary forms are permitted
8.\" provided that the above copyright notice and this paragraph are
9.\" duplicated in all such forms and that any documentation,
10.\" advertising materials, and other materials related to such
11.\" distribution and use acknowledge that the software was developed
12.\" by the University of California, Berkeley. The name of the
13.\" University may not be used to endorse or promote products derived
14.\" from this software without specific prior written permission.
15.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18.\"
19.\" @(#)write.1 6.3 (Berkeley) %G%
2376a151 20.\"
75fb9ded 21.TH WRITE 1 ""
c213cedf 22.UC 4
2376a151 23.SH NAME
c213cedf 24write - send a message to another user
2376a151 25.SH SYNOPSIS
c213cedf
KB
26.B write user
27[
28.B ttyname
29]
30.ft R
2376a151
KM
31.SH DESCRIPTION
32.I Write
c213cedf
KB
33allows you to communicate with other users, by copying lines from
34your terminal to theirs.
2376a151 35.PP
c213cedf 36When you run the
2376a151 37.I write
c213cedf
KB
38command, the user you are writing to gets a message of the form:
39.sp
40.nf
41.ti +5
42Message from yourname@yourhost on yourtty at hh:mm ...
43.fi
44.sp
45Any further lines you enter will be copied to the specified user's
46terminal.
47If the other user wants to reply, they must run
48.I write
49as well.
2376a151 50.PP
c213cedf
KB
51When you are done, type an end-of-file or interrupt character.
52The other user will see the message ``EOF'' indicating that the
53conversation is over.
2376a151 54.PP
c213cedf
KB
55You can prevent people (other than the super-user) from writing to you
56with the
57.IR mesg (1)
2376a151 58command.
c213cedf 59Some commands, for example
2376a151
KM
60.I nroff
61and
c213cedf
KB
62.IR pr ,
63disallow writing automatically, so that your output isn't overwritten.
2376a151 64.PP
c213cedf
KB
65If the user you want to write to is logged in on more than one terminal,
66you can specify which terminal to write to by specifying the terminal
67name as the second operand to the
68.I write
69command.
70Alternatively, you can let
2376a151 71.I write
c213cedf
KB
72select one of the terminals \- it will pick the one with the shortest
73idle time.
74This is so that if the user is logged in at work and also dialed up from
75home, the message will go to the right place.
2376a151 76.PP
c213cedf
KB
77The traditional protocol for writing to someone is that the string ``-o'',
78either at the end of a line or on a line by itself, means that it's the
79other person's turn to talk.
80The string ``o-o'' means that the person believes the conversation to be
81over.
2376a151 82.SH "SEE ALSO"
c213cedf 83mesg(1), talk(1), who(1)