[MonoDevelop] How to run a bash terminal command from Mono/MonoDevelop in Linux?

Hari phariparam at gmail.com
Tue Jul 29 17:07:32 UTC 2014


I want to run the following bash command programmatically using C# and
MonoDevelop and store the output to a variable.



./TestApp  --H



My MonoDevelop/C#  code is as follows:



Process proc = new Process();

proc.StartInfo.FileName = "/bin/bash";

proc.StartInfo.Arguments = "./usr/mono/TestApp --H";

proc.StartInfo.UseShellExecute = false;

proc.StartInfo.RedirectStandardErrort = true;

proc.StartInfo.RedirectStandardInput = true;

proc.StartInfo.RedirectStandardOutput = true;

proc.Start();

string value = proc.RedirectStandardOutput.ReadToEnd()





 The below line displaying the error “*System.InvalidOperationException: No
process is associated with this object*



Process proc = new Process();



Thank You
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-list/attachments/20140729/23614f3b/attachment.html>


More information about the Monodevelop-list mailing list