Tee does not exit after pipeline it's on has finished [closed]

余生颓废 提交于 2019-12-10 12:39:17

问题


So, I've got a rather long and involved script intended to be used by people who aren't going to want to dig into anything that goes wrong.

Recently, during testing, the script froze inexplicably. Long story short, I executed a command in a subshell in order to be able to tee stdout and stderr to my log file:

(/path/to/script -i -ran 2>&1; ) | tee -a /path/to/mylogfile

The script was no longer in the process tree, no longer running, and seems to have exited completely because the file that it writes as its last action was there and not open. However, tee remained, obstinately. I killed tee, and the script proceeded merrily on its way. This is the first time this has happend, and I want to know if there's anything I can do to prevent it from happening again. Any ideas would be most appreciated.

来源:https://stackoverflow.com/questions/9523448/tee-does-not-exit-after-pipeline-its-on-has-finished

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!