I read in the release notes for Mono 2.10 (http://www.mono-project.com/Release_Notes_Mono_2.10) that "the C# REPL now can be used as a program to run C# scripts in Unix. Your Unix scripts can now contain as their first line the #!/usr/bin/csharp line which allows you to create C# scripts that can be treated like programs." The release notes give this very simple demo:
$ echo '#!/usr/bin/csharp' > demo $ echo 'System.Console.WriteLine (10+2);' >> demo $ chmod +x demo $ ./demo 12 $ So I tried it on my machine running 2.10.1, but it always fails with a syntax error. (See below.) Is anyone else able to run this simple demo of the C# REPL? tools$ echo '#!/usr/bin/csharp' > demo tools$ echo 'System.Console.WriteLine (10+2);' >> demo tools$ chmod +x demo tools$ ./demo ./demo: line 2: syntax error near unexpected token `10+2' ./demo: line 2: `System.Console.WriteLine (10+2);' tools$ -SteveL $ uname -a Darwin applejacks 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 $ mono --version Mono JIT compiler version 2.10.1 (tarball Fri Feb 25 15:56:49 MST 2011) Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com TLS: normal SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none Misc: debugger softdebug LLVM: yes(2.9svn-mono) GC: Included Boehm (with typed GC) $ /usr/bin/csharp --version Mono C# compiler version 4.0.0.0
_______________________________________________ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list