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.
精彩评论