如何重新连接到在屏幕中使用 ctrl-a x 停止的进程?
在 Linux 中,我使用 screen 软件,并打开 R 编程语言编辑器。在写作时,我故意按下 ctrl-a x 并从 R 中退出。
但是当运行 ps -la 时,我可以看到 R 仍在运行。
ps -la
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 R 548 2427 32324 0 77 0 - 15875 - pts/1 00:00:00 ps
0 T 548 4109 31462 3 75 0 - 2100701 finish pts/5 10:29:25 R
但显示已完成,是否可以重新连接?
我尝试使用此命令向其发送一些文本,
echo 'save.image()' > /proc/4109/fd/0
但它不起作用。 实际上我已经尝试写入 STDIN,事实上它可以工作,但我需要 \n 到它,当我发送它时只将其视为文本而不是命令,所以我将在 R 编辑器中获取此值,
>save.image()
但返回不考虑插入符号。
有没有人有解决方案,我正在操作的数据是敏感的,不想再次重新执行所有脚本,因为它需要几天的时间来执行和分析数据。
In linux I was using the screen software and I was opening to R programming language editor. When writing I pressed intentionally on ctrl-a x and the go out from R.
but when running ps -la
I can see that R is still running.
ps -la
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 R 548 2427 32324 0 77 0 - 15875 - pts/1 00:00:00 ps
0 T 548 4109 31462 3 75 0 - 2100701 finish pts/5 10:29:25 R
but it is marked with finish, is it possible to reconnect to it?
I have tried to use this command to send some text to it
echo 'save.image()' > /proc/4109/fd/0
but it didn't work.
actually I have tried to write to the STDIN, in fact it works but I need to \n to it, when I send it only consider it as a text no a command, so I will get in the R editor this value
>save.image()
but the return caret is not taken into consideration.
Do any one have a solution for that, the data that I am manipulating is sensitive and don't want re-do all the scripting again because it needs days to execute and analyze the data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,您似乎无意中将 R 进程置于后台。尝试重新连接到屏幕会话,转到原来的 shell/窗口,然后输入
fg
将其再次带到前台。It looks to me like you inadvertently put the R process in the background. Try reattaching to your screen session, go the the shell/window where it was, and type
fg
to bring it to the foreground again.