[Mono-osx] Running a shell script using System.Diagnostics.Process
mattbrindley at googlemail.com
Fri Apr 4 20:57:47 EDT 2008
On 5 Apr 2008, at 07:01, Billy Schoenberg wrote:
> On windows I have used the System.Diagnostics.Process Object, not
> the static Start() method, but one of the instance methods (i need
> to set some of the Properties first), when I try this on OSX no
> luck, nothing really happens at all.
Sorry if you've already done this, but just to be sure: Your process'
fileName should be "/bin/sh" and your first arg is the .sh file you
want to run (because you're outside of bash).
This works for me on 10.5:
using (StreamWriter shScript = File.CreateText("simple.sh"))
shScript.WriteLine("echo It worked!");
Process shScriptProcess = new Process();
shScriptProcess.StartInfo = new ProcessStartInfo("/bin/
$ mono ShDemo.exe
$ mono -V
Mono JIT compiler version 1.9 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
GC: Included Boehm (with typed GC)
Notification: Thread + polling
More information about the Mono-osx