【发布时间】:2012-05-03 15:28:46
【问题描述】:
我的 linux 命令中的星号字符有点问题 - 我需要找出发行版。当我替换这个角色女巫时,例如'fedora' 那么这个命令给出了很好的结果。在这种情况下,它会这样写:/bin/cat: /etc/*-release: Directory or file doesn't exist.
我的代码是:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "cat";
p.StartInfo.Arguments = "/etc/*-release";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
提前感谢您的回答。 马特杰
【问题讨论】: