How do I execute a shell script in C#?

Viewed 10281

I have one file which contains a Unix shell script. So now I wanted to run the same in .NET. But I am unable to execute the same.

So my point is, is it possible to run the Unix program in .NET? Is there any API like NSTask in Objective-C for running Unix shell scripts so any similar API in .NET?

2 Answers
        ProcessStartInfo frCreationInf = new ProcessStartInfo();
        frCreationInf.FileName = @"C:\Program Files\Git\git-bash.exe";
        frCreationInf.Arguments = "Test.sh";
        frCreationInf.UseShellExecute = false;
        var process = new Process(); 
        process.StartInfo = frCreationInf;
        process.Start();
        process.WaitForExit();
Related