向后台进程发送命令 [英] Send command to a background process

查看:25
本文介绍了向后台进程发送命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个先前运行的进程 (process1.sh),它在后台运行,PID 为 1111(或其他任意数字).我怎样才能将 command option1 option2 之类的东西发送到 PID 为 1111 的进程?

I have a previously running process (process1.sh) that is running in the background with a PID of 1111 (or some other arbitrary number). How could I send something like command option1 option2 to that process with a PID of 1111?

不想开始一个新的 process1.sh!

I don't want to start a new process1.sh!

推荐答案

Named Pipes 是您的朋友.请参阅文章 Linux 期刊:在 Bash 中使用命名管道 (FIFO).

Named Pipes are your friend. See the article Linux Journal: Using Named Pipes (FIFOs) with Bash.

这篇关于向后台进程发送命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆