如何在csh脚本中的调用父进程中查看子进程的STDOUT
我正在调用一个 csh 脚本,它所做的第一件事就是启动一个新组。
我需要能够看到分叉后执行的子进程的标准输出。 我还希望父进程“挂起”直到子进程完成。
这是脚本 (razor_from_cgwin.sh
)。
(某种程度上)
newgrp name
source /stuff/morestuff/stuffiwant
razor -c thread -f Keil1403 -g lib . -o
chmod +x *
./rz_build*
> server{me}:./razor_from_cgwin.sh
> server{me}:
我想要的是这样的:
>server{me}:./razor_from_cgwin
>(hang)
>any output from child forked process
>server{me}:
Razor 是我在我正在从事的项目中使用的 CM。 除了我需要启动一个新组来调用它之外,这对这个问题并不重要。 我正在从 CYGWIN 的 ssh 会话调用脚本 (./razor_from_cgwin.sh
):)
I am calling a csh script that the first thing it does is starts a new group.
I need to be able to see the standard output from the child process that is executed after the fork. I also want the parent process to 'hang' unitl the child process is finished.
Here is the script (razor_from_cgwin.sh
).
(sort of)
newgrp name
source /stuff/morestuff/stuffiwant
razor -c thread -f Keil1403 -g lib . -o
chmod +x *
./rz_build*
> server{me}:./razor_from_cgwin.sh
> server{me}:
What I want is this:
>server{me}:./razor_from_cgwin
>(hang)
>any output from child forked process
>server{me}:
Razor is the CM I am using on the project I am working on.
It is not important to this problem except that i need to start a new group to call it.
I am calling the script (./razor_from_cgwin.sh
) from a ssh session from CYGWIN :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来很奇怪——如果这是一个 Unix 系统,我就没有理由不能想到为什么你不会自动看到子进程的输出。
That seems odd - if this was a Unix system there's no reason I can think of why you wouldn't automatically see the output from the child process.
问题解决了。 最初的问题是我在脚本中分叉了一个子进程。
现在我使用“此处文档”。 我在调用控制台中看到输出。 所以阿尔尼塔克是正确的。
Problem solved. The original problem was that I was forking a sub prcoess in the script.
Now that I use "Here Documents". I see the output in my calling console. So Alnitak was correct.