mono, shell scripting?

2019-02-26 21:48发布

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?

标签: shell mono
1条回答
迷人小祖宗
2楼-- · 2019-02-26 22:16

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.

查看更多
登录 后发表回答