Come inviare un messaggio a un punto specifico?


8

Questa è una voce dell'output di who:

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

C'è un modo per inviare un messaggio lì?

Risposte:


14

Prova questo:

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

vedere: man 1 write


o echo "message" > /dev/pts/6


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

o

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

o per scrivere più righe:

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

Dove ^ D = CTRL + D.


2
-1 perché questo non aggiunge nulla alla risposta esistente
HBruijn
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.