How do I run a command in a different tty?
Copy and paste this code on ttyecho.c
Compile it using gcc -O3 -o ttyecho ttyecho.c
Use it ./ttyecho -n /dev/pts/1 ls
Depends on your terminal environment:
- In Linux with the console:
openvt _command_
- Within a terminal in screen:
screen _command_
- Within X Windows (Mac as well):
xterm -e "_command_"