![]() |
1
2
有些进程在关闭stdout后会挂起一段时间是正常的(即,从中读取文件结束)。你需要打电话
|
![]() |
2
0
只是一个可能有助于调试的随机想法。尝试将shell脚本更改为:
检查并查看它打印的行是否与您期望它运行的命令匹配。shell脚本中的命令行参数处理可能没有按您希望的方式进行。 我不知道您对脚本的输入应该是什么,但是路径之前的$1在我看来有点不合适。 |
![]() |
3
0
你确定要这样做吗
$@扩展到所有参数。“$@“扩展到所有由空格连接的参数。我怀疑你的shell脚本不正确。你没有明确说明你想要脚本做什么,所以这限制了我们提出建议的可能性。 |
![]() |
4
0
比较shell和脚本中的环境变量。 |
![]() |
5
0
尝试将“cd$1/hooks/”放在运行mono的行之前。您可能在该文件夹中有一些程序集,这些程序集在从shell中的该文件夹运行mono时找到,但在运行脚本时找不到。 |
![]() |
6
0
在验证了我的代码之后 做 从命令行开始工作,我发现它不再工作了!我查看了我的.NET代码,看看是否有什么意义。 以下是我的经历: static public int Execute(string sCMD, string sParams, string sComment, string sUserPwd, SVNCallback callback) { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.UseShellExecute = false; proc.StartInfo.Verb = "open"; proc.StartInfo.FileName = "svn"; proc.StartInfo.Arguments = Cmd(sCMD, sParams, sComment, UserPass()); proc.Start(); int nLine = 0; string sLine = ""; while ((sLine = proc.StandardOutput.ReadLine()) != null) { ++nLine; if (callback != null) { callback.Invoke(nLine, sLine); } } int errorCode = proc.ExitCode; proc.Close(); return errorCode; } 我改变了这个: while (!proc.HasExited) { sLine = proc.StandardOutput.ReadLine(); if (sLine != null) { ++nLine; if (callback != null) { callback.Invoke(nLine, sLine); } } } int errorCode = proc.ExitCode;
看起来这个过程比我得到的输出要长一点,因此
|
![]() |
CaTx · 使用带有一个大于号和两个大于号的回波的区别 2 年前 |
![]() |
Ari157 · x86_64 Linux程序集中的逻辑与实现 2 年前 |
![]() |
Ty Q. · 分段故障GLFW3/GLAD 2 年前 |
![]() |
ShortArrow · 如何使用git管理链接源文件? 3 年前 |
![]() |
Bastien L. · 多Linux Grafana集成 3 年前 |