gpt4 book ai didi

c++ - 如何在 unix shell 中在后台执行命令?

转载 作者:太空宇宙 更新时间:2023-11-04 10:13:35 25 4
gpt4 key购买 nike

Execute the command and return immediately, not blocking until the command finishes.
Concepts: Background execution, signals, signal handlers, processes, asynchronous execution System calls: sigset()

如何?

最佳答案

如果您不想向当前终端发送垃圾邮件,您可以将输出定向到一个单独的缓冲区,一个文件。

yourapp >> ~/tempOutput.txt &

如果你想把它输出到“无处”,你可以重定向到 null

yourapp >> /dev/null &

关于c++ - 如何在 unix shell 中在后台执行命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47481424/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com