[Mono-list] Command line parsing

Chris Seaton chris at chrisseaton.com
Wed Jan 31 07:19:33 EST 2007


Ah yeah, I found the problem.

I'm using a wrapper shell script to run mono on my program.

#!/bin/sh
mono foo.exe $@

When I call the script with

a "b c"

$@ comes out as

a b c

Lots of people use these wrapper scripts, don't they? How should I be  
doing it?

Thanks

Chris Seaton

On 31 Jan 2007, at 10:35, Paolo Molaro wrote:

> On 01/31/07 Chris Seaton wrote:
>> I'm using svn Mono on OS X. I wrote a program that prints out each
>> arg on a line.
> [...]
>> $ mono test.exe a "b c"
>> a
>> b
>> c
>>
>> That's wrong - I would expect.
>>
>> a
>> b c
>>
>> It's the shell's job to parse the command line isn't it? I'm using
>> bash, and other programs, such as Python are getting it right. How is
>> mono managing to get it wrong?
>
> It doesn't, because it works correctly and prints:
> a
> b c
> So you're doing something wrong in your box or not telling everything.
>
> lupus
>
> -- 
> -----------------------------------------------------------------
> lupus at debian.org                                     debian/rules
> lupus at ximian.com                             Monkeys do it better
> _______________________________________________
> 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