I need to write commands from one terminal to another terminal.
I tried these:
echo -e "ls\n" > /proc/pid/fd/0
echo -e "ls\n" > /dev/pts/4
Which just prints the ls
as output and doesn't execute.
I tried these:
chmod 777 /dev/tty4 ;echo "ls" > /dev/tty4
chmod 777 /dev/tty40 ;echo "ls" > /dev/tty40
Which don't seem to do anything
Any ideas?
[note that I don't want to touch the second terminal to accomplish this. only the first one]