mono, shell scripting?

2019-02-26 22:00发布

问题:

csharp ( version Mono C# compiler version 4.0.0.0) allow to write C# scripts, like

#!/usr/bin/csharp

Console.WriteLine( "Hello world !" );

I tried to add a main() function, but got parsing errors, like

{interactive}(1,9): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='

Are there docs about this scripting ?

Does it allow use of functions?

回答1:

You need a newer version of mono/csharp: either wait for a new release of mono 2.11.x/2.12.x or compile it yourself from git. That allows you to define classes interactively.



标签: shell mono