WRITE(1) — User’s Manual — Commands
NAME
write − write to another user
SYNOPSIS
write user [ ttyname ]
DESCRIPTION
Write copies lines from your standard input to user’s screen.
When you type a write command, the person you’re writing to sees a message like this:
Message from hostname!yourname on yourttyname at hh:mm . . .
After typing the write command, enter the text of your message. What you type appears ‘simultaneously’ on the other user’s screen. Conclude by typing an end of file indication (^D) or an interrupt. At this point write displays ‘EOT’ on your recipient’s screen and exits.
To write to a user who is logged in more than once, use the ttyname argument to indicate the appropriate terminal name.
You can grant or deny other users permission to write to you by using the mesg command (default allows writing). Certain commands, nroff and pr(1) in particular, don’t allow anyone to write to you while you are using them in order to prevent messy output.
If write finds the character ‘!’ at the beginning of a line, it calls the shell to execute the rest of the line as a command.
Two people can carry on a conversation by write’ing to each other. When the other person receives the message indicating you are writing to him, he can then write back to you if he wishes. However, since you are now simultaneously typing and receiving messages, you end up with garbage on your screen unless you work out some sort of scheduling scheme with your partner. You might try the following conventional protocol: when you first write to another user, wait for him to write back before starting to send. Each person should end each message with a distinctive signal — o for ‘over’ is standard — so that the other knows when to begin a reply. To end your conversation, type oo — for ‘over and out’ — before finishing the conversation.
FILES
/etc/utmpto find user
/bin/shto execute ‘!’
SEE ALSO
Sun System Release 0.3 — 27 April 1983