On Jan 20, 2011, at 3:42 PM, karolo84 wrote:
> I have tried to figure out the following by myself but so far I wasn't
> lucky: I have a .NET program that takes a SQL query as command line
> argument. If I now run that program under Windows, I simply quote the string
> and everything is fine:
> 
> app.exe "SELECT foo FROM bar WHERE time='20090212';"
> 
> But I have not yet successfully got that running under Linux + Mono.

What shell are you using?!

For the trivial app:

        public static void Main (string[] args)
        {
                for (int i = 0; i < args.Length; ++i)
                        Console.WriteLine ("args[{0}]={1}", i, args [i]);
        }

when using bash on Linux and OSX:

        $ mono a.exe "SELECT foo FROM bar WHERE time='20090212';"
        args[0]=SELECT foo FROM bar WHERE time='20090212';

        $ mono a.exe "a b"
        args[0]=a b

        $ mono a.exe "a\ b"
        args[0]=a\ b

        $ mono a.exe 'a b'
        args[0]=a b

        $ mono a.exe ´a b´
        args[0]=´a
        args[1]=b´

In short, I can't reproduce your behavior.  All I can guess is that you're 
using a shell with bizarre quoting rules...

 - Jon

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to