名前
write - 他のユーザーにメッセージを送る
書式
write user[@host] [ttyname]
説明
write は、ネットワーク越しにユーザーの端末の行を他のユーザーの端末にコピ
ーすることにより、他のユーザーとの通信を可能にする。
write コマンドを実行すると、相手のユーザーは以下の形式のメッセージを受け
取る。
Message from yourname@yourhost on yourtty at hh:mm ...
この後に入力された行は、指定されたユーザーの端末に入力が終るごとにコピー
される。相手のユーザーが返答したい場合は、同様に write を実行しなければな
らない。
メッセージを送り終ったら、end-of-file かインタラプト文字を入力すること。
相手のユーザーは、会話が終ったことを表す ‘EOF’ というメッセージを受け取る
。
ユーザーは (スーパーユーザー以外の) 他のユーザーがメッセージを書き込むの
を mesg(1) コマンドを使って防ぐことができる。 nroff(1) や pr(1) といった
コマンドは、ユーザーの出力が上書きされないように、自動的に書き込みを不可
にする。
メッセージを書き込みたい相手のユーザーが複数の端末にログインしている場合
、 write コマンドの 2 番目の引き数として端末名を指定することにより、どの
端末に書き込むかを指定できる。逆に、ユーザーは書き込む端末を write に選ば
せることができる - この場合、アイドル時間が最も短い端末を選択する。ユーザ
ーが職場でログインしている場合や、自宅からダイヤルアップで接続している場
合でも、この選択方式によりメッセージは適切な端末に送られる。
誰かにメッセージを書く際の伝統的な取り決めとしては、次のようなものがある
。文字列 ‘-o’ が行末や単独で一行にある場合、それは相手のユーザーの話す番
になったことを意味する。文字列 ‘oo’ は、ユーザーが会話が終了したと考えて
いることを意味する。この取り決めが失敗した場合や使われなかった場合、「再
描画」文字 (通常は ^R) が役立つことに気づくかもしれない。
ローカルで発展した他の取り決めとしては、次のようなものがある。複数のユー
ザーで会話をする場合、各行の先頭に (d) といった括弧に入った識別情報を置く
。これは複数のユーザーから来たメッセージを区別するとともに、相手のユーザ
ーにも同じようにすべきであると教える働きがある。
関連項目
mesg(1), talk(1), finger(1), rwho(1), who(1)
履歴
write コマンドは Version 6 AT&T UNIX で登場した。ネットワーク上の人々は
write が Project Athena に関連して MIT で開発されたことを知っている。
翻訳者謝辞
この man ページの翻訳にあたり、 FreeBSD jpman project
WRITE(1) Linux Programmer’s Manual WRITE(1) NAME write - send a message to another user SYNOPSIS write user [ttyname] DESCRIPTION Write allows you to communicate with other users, by copying lines from your terminal to theirs. When you run the write command, the user you are writing to gets a mes- sage of the form: Message from yourname@yourhost on yourtty at hh:mm ... Any further lines you enter will be copied to the specified user’s ter- minal. If the other user wants to reply, they must run write as well. When you are done, type an end-of-file or interrupt character. The other user will see the message EOF indicating that the conversation is over. You can prevent people (other than the super-user) from writing to you with the mesg(1) command. Some commands, for example nroff(1) and pr(1), may disallow writing automatically, so that your output isn’t overwritten. If the user you want to write to is logged in on more than one termi- nal, you can specify which terminal to write to by specifying the ter- minal name as the second operand to the write command. Alternatively, you can let write select one of the terminals - it will pick the one with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message will go to the right place. The traditional protocol for writing to someone is that the string ‘-o’, either at the end of a line or on a line by itself, means that it’s the other person’s turn to talk. The string ‘oo’ means that the person believes the conversation to be over. SEE ALSO mesg(1), talk(1), who(1) HISTORY A write command appeared in Version 6 AT&T UNIX. AVAILABILITY The write command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. 12 March 1995 WRITE(1)
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa