SharpSsh - 脚本在 csh 和 ksh 中运行两次
我正在使用 SharpSsh 从 ASP.NET/C# 运行脚本。我意识到当脚本运行并从 unix 执行 ps -ef grep 时,我看到同一个脚本运行两次,一个在 csh -c 中,另一个在 ksh 中。该脚本有 shebang ksh,所以我不确定为什么 csh 的副本也在运行。另外,如果我直接从 unix 运行相同的脚本,则只有一份副本使用 ksh 运行。脚本内没有其他 shell 运行。
i'm running a script from ASP.NET/C# using SharpSsh. I realize when the script runs and i do a ps -ef grep from unix, i see the same script running twice, one in csh -c, and the other with ksh. The script has shebang ksh, so i'm not sure why a copy of csh is also running. Also if i run the same script directly from unix, only one copy runs with ksh. There's no other shell running from within the script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大多数 Unix/Linux 现在都有一个命令或选项,可以显示进程树,并带有缩进列表,例如查找 ps OR ptree OR 的 -t 或 -T 选项
我打赌您会看到 csh 是用户登录 shell,其中包含您的脚本作为参数(您可能必须使用 ps 的不同选项来查看 csh 进程的完整命令行)并且作为子进程,您您将看到 ksh 执行您的脚本,以及 ksh 下针对脚本调用的任何外部命令的进一步子进程。
我希望这有帮助。
PS,由于您似乎是新用户,如果您得到的答案对您有帮助,请记住将其标记为已接受,或给它一个+(或-)作为有用的答案。
Most Unix/Linux now have a command or option that will show process trees, with indented list like, look for -t or -T options to ps OR ptree OR ???
I bet you'll see that the csh is the user login shell that includes your script as an argument ( you may have to use different options to ps to see the full command-line of the csh process) AND as a sub process you'll see ksh executing your script, and further sub-processes under ksh for any external commands that the script is calling.
I hope this helps.
P.S. as you appear to be a new user, if you get an answer that helps you please remember to mark it as accepted, or give it a + (or -) as a useful answer.