When you issue a write to /dev/pts/X
(/proc/6350/fd/0
, 1
and 2
is just a symlink to that), what happens is exactly the same thing that happens when process 6350
(or one of its children, suitably forked) outputs something: it writes to the terminal.
If you try to read from that device (cat < /dev/pts/X
), funky things will happen. You should see the things you type in the original shell show up. (Quite possibly only after the first new line you typed - I'm guessing the terminal program (xterm
or whatever you're using) does some line buffering, and the 6350
shell that was blocked on read
gets that piece; then either shell might, or might not, win the subsequent reads, but I might very well be completely wrong on this.)
The thing is: when you read from or write to that device, you're not talking to the other shell that is using it. You're talking to the terminal emulator (xterm
for example). Only the terminal emulator can inject data into that channel (what the shell reads), and all that the shell writes goes to the terminal. Attaching a second shell doesn't change that.
If you want to inject commands into that 6530
process, it will have to do that via the terminal (whether that's an X11 app or something else).
Recommended reading: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?