如何使读取stdin的程序在Linux上的后台运行? [英] How to make a program reading stdin run in background on linux?

查看:63
本文介绍了如何使读取stdin的程序在Linux上的后台运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序在 while 循环中从标准输入中读取.即使关闭控制台,我也需要在后台运行它.如果程序的名称是 prog ,我该怎么做?

I have a program reading from standard input in a while loop. I need to run it in the background, even after I close the console. If the name of the program is prog, how can I do that?

推荐答案

24年前开始使用UNIX时,我遇到了同样的问题.

When I started with UNIX 24 years ago I had the same question.

如果您是新手,那么您要寻找的是 tmux :您可以在这里启动一个从STDIN读取的程序,注销,稍后再登录,然后继续.

If you are a newbie then what you are looking for is tmux: Here you can start a program that reads from STDIN, log out, log back in some time later, and continue.

否则, nohup 是正确的答案.

这篇关于如何使读取stdin的程序在Linux上的后台运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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