WRITE(1) USER COMMANDS WRITE(1) NAME write - write a message to another user SYNOPSIS write _u_s_e_r_n_a_m_e [ _t_t_y_n_a_m_e ] DESCRIPTION write copies lines from your standard input to _u_s_e_r_n_a_m_e's screen. When you type a write command, the person you are writing to sees a message like this: Message from _h_o_s_t_n_a_m_e!_y_o_u_r_n_a_m_e on _y_o_u_r_t_t_y_n_a_m_e After typing the write command, enter the text of your mes- sage. What you type appears line-by-line on the other user's screen. Conclude by typing an EOF indication (CTRL- D) or an interrupt. At this point write displays EOF on your recipient's screen and exits. To write to a user who is logged in more than once, use the _t_t_y_n_a_m_e 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(1) and pr(1V) in particular, do not 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 com- mand. Two people can carry on a conversation by "writing" to each other. When the other person receives the message indicat- ing 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. EXAMPLE Here is an example of a short dialog between two people on different terminals. Two users called "Horace" and "Eudora" are logged in on a system called "jones". To illustrate the Sun Release 4.1 Last change: 2 October 1989 1 WRITE(1) USER COMMANDS WRITE(1) process, both users' screens are shown side-by-side: Eudora's Terminal Horace's Terminal _H_o_r_a_c_e _i_s _s_t_a_r_i_n_g _a_t _h_i_s _s_c_r_e_e_n jones% write horace how about a squash game tonight? -o- Message from jones!eudora on tty09 at 17:05 ... how about a squash game tonight? -o- jones% write eudora I'm playing tiddlywinks with Carmeline -o- Message from jones!horace on tty03 at 17:06 ... I'm playing tiddlywinks with Carmeline -o- How about the beach on Sunday? -o- How about the beach on Sunday? -o- Sorry, I'm washing my tent that day -o- Sorry, I'm washing my tent that day -o- See you when I get back from Peru -oo- See you when I get back from Peru -oo- ^D jones% EOF I hear rack of llama is very tasty -oo- ^D I hear rack of llama is very tasty -oo- EOF jones% ENVIRONMENT The environment variables LC_CTYPE, LANG, and LC_default control the character classification throughout write. On entry to write, these environment variables are checked in the following order: LC_CTYPE, LANG, and LC_default. When a valid value is found, remaining environment variables for character classification are ignored. For example, a new setting for LANG does not override the current valid charac- ter classification rules of LC_CTYPE. When none of the values is valid, the shell character classification defaults to the POSIX.1 "C" locale. FILES /etc/utmp to find user /usr/bin/sh to execute ! SEE ALSO mail(1), mesg(1), pr(1V), talk(1), troff(1), who(1), locale(5) Sun Release 4.1 Last change: 2 October 1989 2