I have a terminal (xterm) open with bash running in it, showing a prompt. Suppose I know this running bash's pid and the tty associated with this terminal. Is there any way, not touching this terminal at all, but only use the tty and pid information, to ask this very running bash to run a command? Naively echo "command" > tty would only show the command in the terminal but bash doesn't receive it as a user input.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…