如何发送消息到特定的点?


8

这是以下输出的一项who

yang     pts/6        2011-06-22 09:25 (10.231.22.12)

有没有一种发送消息的方式?

Answers:


14

尝试这个:

write yang /dev/pts/6
#type your message
#ctrl + D (EOF) 

看到: man 1 write


要么 echo "message" > /dev/pts/6


-2
~# tty
/dev/pts/89
~# echo hello to myself >/dev/pts/89
hello to myself

要么

~# echo hello to myself >`tty`
hello to myself

或写几行:

~# cat >>`tty`
hello
from another
way
of doing this
^D

其中^ D = CTRL + D。


2
-1,因为它们不会为现有答案添加任何内容
HBruijn
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.