[Mono-list] csharp REPL
xtzgzorex at gmail.com
Tue Jun 28 14:19:32 EDT 2011
Arguments should be stored in Environment.CommandLine.
On Tue, Jun 28, 2011 at 7:58 PM, Ian Norton
<Ian.Norton-Badrul at thales-esecurity.com> wrote:
> Try looking at Mono.Options (aka NDesk.Options)
> That works quite well for me.
> Oh.. You don't have a main in repl that gets argv...
> Are the command line arguments stored in the environment somewhere?
> On 28 Jun 2011, at 18:59, "Steve Lessard" <s_lessard at yahoo.com> wrote:
>> I'm trying to write a shell script in C# using the csharp REPL. The
>> script below works fine as is on OS X, but I would like to pass an
>> argument into this script. I haven't been able to find any docs on how
>> to do this and all of my experiments have turned up nothing. Is
>> there a
>> way to pass an argument into the csharp REPL?
>> I'm running Mono version 2.10.2 with Mono C# compiler version 188.8.131.52
>> #!/usr/bin/env csharp -lib:$PWD
>> // Initialize the "epoch"
>> // The "epoch" is 12:00:00 AM UTC, January 1, 1970
>> DateTime epoch = new DateTime().AddYears(1969).AddHours(-8);
>> TimeSpan nowDiff = (DateTime.Now - epoch);
>> System.Console.WriteLine("Current Time (Total Seconds): " +
>> System.Console.WriteLine("Current Local Time: " +
>> System.Console.WriteLine("Current UTC Time: " +
>> Mono-list maillist - Mono-list at lists.ximian.com
> Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list