Executing string sent from one terminal in another in Linux pseudo-terminal

前端 未结 4 1859
夕颜
夕颜 2021-01-29 08:57

Lets say I have one terminal where the output of \"tty\" is \"/dev/pts/2\" From another terminal, I want to send a command to the first terminal and execute it. Using: echo \"ls

4条回答
  •  余生分开走
    2021-01-29 09:58

    I realize it's a year late, but there is a simpler way I think. Doesn't this work?

    ls > /dev/pts/2
    

    It works on my system.

提交回复
热议问题