[Mono-list] Scripting the Linux OS with Mono

Abe Gillespie abe.gillespie at gmail.com
Thu Nov 10 19:47:38 EST 2005


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 <kornelpal at hotmail.com> 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" <abe.gillespie at gmail.com>
> To: "MonoList" <mono-list at 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 at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>


More information about the Mono-list mailing list