[Mono-list] Command Line Parsing
Abe Gillespie
abe.gillespie at gmail.com
Tue Nov 8 13:29:36 EST 2005
Ok, this is probably the problem then.
Thanks.
-Abe
On 11/8/05, Andrew Vick <avick at remote-print.com> wrote:
> Abe Gillespie wrote:
> > Any thoughts on the bug (maybe?) I encountered. I'll file it if
> > someone confirms it.
> >
> >>>2. I think I ran into a bug playing around with the command line.
> >>>When I send an asterisk "*" as one of the arguments I get some weird
> >>>stuff. On Windows it seems to work ok. Try the fsollowing with an
> >>>asterisk as one of the args:
> >>>
> >>>using System;
> >>>class Program
> >>>{
> >>> static void Main(string[] args)
> >>> {
> >>> foreach (string s in args)
> >>> Console.WriteLine(s);
> >>> }
> >>>}
>
> If you are seeing this bug under unix-like systems, be aware that command shells expand wildcards before passing the arguments to the application. You can verify this by running the command:
>
> echo *
>
> That should give the same results as your program. If you want to pass a literal *, you'll need to quote or escape it on the command line:
>
> echo \*
>
> -Andrew V.
> _______________________________________________
> 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