Sending a message to another logged-in user
You can send messages to other logged-in users over the system in real time with the write command. Each user alternately sends and receives short messages from the other workstation. Long messages can be sent by putting the complete message in a file and then redirecting that file as input to the write command.
For another user (as specified by the User parameter) to receive
a message, that user must be logged in and must not have refused message permission.
When a message is sent to a user who is not logged in, the message user
not logged in
displays. If the message is sent to a user who has
refused message permission by setting the mesg command
to no, the message write: permission denied
displays.
Message from SenderID on SenderHostname (ttynn) [Date] ...
With a successful connection, the write command sends two ASCII BEL characters to both workstations. The beep alerts the sender that the message can begin, and it alerts the receiving user that a message is coming.
The following are examples of how to use the write command:
- To write a message to a user who is logged in, type:
Press the Enter key and type:write june
Then press the Ctrl-D key sequence to terminate the write command mode.I need to see you! Meet me in the computer room at 12:30.
If your user ID is karen and you are using workstation tty3, June's workstation displays:
Message from karen on trek tty3 Aug 17 11:55:24 ... I need to see you! Meet me in the computer room at 12:30.<EOT>
- To conduct a conversation, type:
Press the Enter key and type:write june
This starts the conversation. TheMeet me in the computer room at 12:30. o
o
at the beginning of the next line means the message is over. It tells June that you are waiting for a response. Do not press Ctrl-D if you want to continue the conversation.Now June replies by typing:
She presses the Enter key and types:write karen
And you might respond:I'm running tests at 12:30. Can we meet at 3? o
OK--the computer room at 3. oo
The
oo
means over and out, telling June that you have nothing more to say. If June has also indicated that she has finished by typing oo. Then you both press Ctrl-D to end the conversation.- To write someone a prepared message, type:
This writes the contents of the message.text file to June's workstation.write june < message.text