开发者

How to call shell script from net assembly

Need to call unix shell script from a Net assembley开发者_开发技巧, how would I do it.. and return tabular result(key value pair(s)) to the caller.


Assuming you are running your code in Mono on Linux, you should be able to do something like this:

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "myscript.sh";
proc.Start();

I see you have now added that you need to be able to parse the output from the shell script. Take a look at this more complex example that shows how to get the output of the script.

It is hard to give advice on how to actually parse the output, as you don't give us an example of what the output looks like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜