脚本完成后退出屏幕

发布于 2024-08-06 16:13:04 字数 347 浏览 2 评论 0原文

当我在屏幕中启动的脚本完成后,我可以告诉它关闭它所在的当前屏幕吗? 如果是这样怎么办? 我知道我可以先按“ctrl + a”,然后按 k,然后按 y。想要杀死它,但我不在那里发布那些按钮。 我尝试在脚本末尾添加“退出”,这似乎并没有将其关闭。

我还有一个脚本,可以在屏幕中自动启动另一个脚本,这似乎可行,但我不能 100% 确定我的所有语法都正确吗?

screen -dm -S "script0$scriptID"; sleep 1; screen -S "fscript0$scriptID" -X screen ./script.sh "$input1" "$input2"

谢谢任何帮助。

When a script that I started in a screen is finished can I tell it to close the current Screen it's in?
If so how?
I know I can do "ctrl + a" then k, then y. To kill it but Im not there to issue those buttons.
And I tried adding "exit" to the end of the script which doesn't seem to close it ether.

I also have a script that will auto start another script in a screen, this seems to work, but Im not 100% sure that I got all the syntax right?

screen -dm -S "script0$scriptID"; sleep 1; screen -S "fscript0$scriptID" -X screen ./script.sh "$input1" "$input2"

Thanks any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浮华 2024-08-13 16:13:04

此命令将导致 screen 的当前会话退出:

screen -X quit

第二个问题中的命令语法对我来说看起来没问题。您能否更具体地说明您认为可能存在问题的地方?

This command will cause the current session of screen to quit:

screen -X quit

The syntax of the command in your second question looks OK to me. Can you be more specific about where you think there might be a problem?

知你几分 2024-08-13 16:13:04

有时,可以通过向其发送中止键序列来杀死保持打开屏幕的顽固脚本:

screen -X -S "script0$scriptID" stuff "^C"

Sometimes a stubborn script holding open a screen can be killed by sending it an abort key sequence:

screen -X -S "script0$scriptID" stuff "^C"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文