Is there a way to send something like an "end of data" after executing
echo "test" > /dev/tty1
in order to gain the "input cursor" back to "receiving" terminal (in this case tty1)?
Screenshot: http://picload.org/image/acdwigg/tty.png
/dev/tty stands for the controlling terminal (if any) for the current process. To find out which tty's are attached to which processes use the "ps -a" command at the shell prompt (command line). Look at the "tty" column. For the shell process you're in, /dev/tty is the terminal you are now using.
The echo command is used to display a line of text that is passed in as an argument. This is a bash command that is mostly used in shell scripts to output status to the screen or to a file.
For each process, the /dev/tty special file is a synonym for the controlling terminal associated with that process. By directing messages to the tty file, application programs and shell sequences can ensure that the messages are written to the terminal even if output is redirected.
Using echo > /dev/tty
you can't achieve that. But you can do that by sending a signal to process which are using that tty.
For example:
kill -s SIGINT `ps -ft pts/2 | grep pts/2 | cut -d ' ' -f 5`
$ 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With