我想将一个进程放到后台,并多次向其输入数据。例如:
cat & # The command I want to write into
cat_pid=$! # Getting the process id of the cat process
echo hello | $cat_pid # This line won't work, but shows what I want to
# do: write into the stdin of the cat process
我已经获取了PID,如何向该进程写入内容?如果可以,我希望能以不同的方式启动cat进程。
另外,我使用的是Mac系统,所以无法使用/proc
:(