Compiling into an exe, running it, and then deleting is an obvious work around ... but I'd prefer a solution that takes a specifically designed script and runs the script itself. I could see this being done in a separate host exe that expects a script adhering to a specific contract. So the command line would like something like:
mono script_host.exe MyScript.cs myarg1 myarg2 Where script_host might expect a certain interface to be implemented in MyScript.cs. Obviously the assemblies MyScript.cs references would have to be supplied somehow to script_host ... but as flexible as Mono / .Net is it shouldn't be a problem. Has anyone out there done something or started a project like this? -Abe On 11/10/05, Kornél Pál <[EMAIL PROTECTED]> wrote: > Hi, > > You have to compile C# code using mcs that will result in a .exe assembly > that can be executed using mono: > > $mcs some.cs > $mono some.exe > > If you prefer you can write a shell script that will do this as a single > step. > > Kornél > > ----- Original Message ----- > From: "Abe Gillespie" <[EMAIL PROTECTED]> > To: "MonoList" <mono-list@lists.ximian.com> > Sent: Friday, November 11, 2005 1:02 AM > Subject: [Mono-list] Scripting the Linux OS with Mono > > > Hey all, > > I was wondering if there's any easy way to run C# scripts in Mono. > I'm fairly new to Linux (just at about a year) and I'd like to avoid > learning yet another language (Perl, sh, etc.). Has anyone written a > .Net program that takes a file as input and runs that code? Perhaps > Mono can do this natively? How cool would it be to have startup > scripts written in C#?! > > Thanks for the help as always. > -Abe > _______________________________________________ > Mono-list maillist - Mono-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-list > > _______________________________________________ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list