[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System User's Guide: Operating System and Devices

Sending Messages to Another Logged-In User (write Command)

You can send messages to other users over the system in real time with the write command. It provides conversation-like communication with another logged-in user. 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.

When the write command is issued, it immediately sends the following message, along with an attention-getting sound (the ASCII BEL character) to the message recipient or target:

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.

For example, to write a message to user june who is logged in, enter:

write june

Press the Enter key and type:

I need to see you! Meet me in the computer room at 12:30.

Then press the Ctrl-D key sequence to terminate the write command mode.

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>

For example, to hold a conversation with user june, enter:

write june

Press the Enter key and type:

Meet me in the computer room at 12:30.
o

This starts the conversation. The 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 wish to continue.

Now June replies by typing:

write karen

She presses the Enter key and types:

I'm running tests at 12:30. Can we meet at 3?
o

And you might respond:

OK--the computer room at 3.
oo

The oo means "over and out," telling June that you have nothing more to say. If June is also finished oo, then you both press Ctrl-D to end the conversation.

For example, to write user june a prepared message, enter:

write june < message.text

This writes the contents of the message.text file to june's workstation.

For example, to write to the person using the workstation console, enter:

write console

Press the Enter key and type:

The printer in building 998 has jammed.
Please send help.

Then press the Ctrl-D key sequence.

This writes the message to the person logged in at the workstation /dev/console.

You can use the write command to converse with users on other hosts. You can identify a user on a remote host by using the -nHostname flag or the User@Host parameter. In order to write to a user on a remote host, the writesrv daemon must be running on both the current host and the remote host.

For example, to send a message to user spuds at remote host partya, enter:

write -n partya spuds

Press the Enter key and type:

Your new tape has just arrived,
come see me to pick it up.
Thanks!

Then press the Ctrl-D key sequence.

OR

write spuds@partya

Press the Enter key and type:

Your new tape has just arrived,
come see me to pick it up.
Thanks!

Then press the Ctrl-D key sequence.

See the write command in the AIX Version 4.3 Commands Reference for the exact syntax.

Related Information

Commands Overview

Processes Overview

File Systems Overview

Directory Overview

Files Overview

File and System Security

User Environment and System Information


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]