/dev/tty1 to get the "input cu...">

How can I echo / dev / tty?

Is there a way to send something like "end of data" after execution

echo "test" > /dev/tty1

to get the "input cursor" back to the "receiving" terminal (in this case tty1)?

Screenshot: http://picload.org/image/acdwigg/tty.png

+7
source share
4 answers

Using echo > /dev/tty , you cannot achieve this. But you can do this by sending a signal to the process that this tty uses.

For example:

 kill -s SIGINT `ps -ft pts/2 | grep pts/2 | cut -d ' ' -f 5` 
+1
source

You cannot do that. The redirection operator '>' makes it so that the echo command is used for standard WHOLE time input, and you cannot just change it later.

You might want to rethink your needs and implementation.

+1
source
 $ echo "test" > /dev/tty test 
  Cygwin supports the following character devices commonly found on POSIX systems:

 / dev / tty The current controlling tty of a session.

Special filenames

0
source

centos will print your line in the console of your choice

 #run on pts/8 [ root@C203-ATC ONT]# uname -a Linux C203-ATC 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux [ root@C203-ATC ONT]# echo "test" > /dev/pts/3 [ root@C203-ATC ONT]# [ root@C203-ATC BASIC]# tty /dev/pts/3 #checked on pts/3 [ root@C203-ATC BASIC]# test (cursor) #cursor pending ... 
0
source

All Articles