[Mono-list] Command line parameters with spaces

karolo84 karolo84 at binkmail.com
Thu Jan 20 17:58:56 EST 2011


Hi all, 

having found nothing on the web when searching for it made me fear it will
either be trivial or very special.

[user at cluster ~]$  /opt/novell/mono/bin/mono /home/user/bin/a.exe "SELECT
foo FROM bar WHERE time='20090212';"
args[0]=SELECT
args[1]=foo
args[2]=FROM
args[3]=bar
args[4]=WHERE
args[5]=time='20090212';
[user at cluster ~]$

and the code is like yours:

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

The shell in user is 

[user at cluster ~]$ echo $SHELL
/bin/bash

on 

Rocks 5.3 (Rolled Tacos)
uname -a
Linux cluster 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:12:36 EST 2009 x86_64
x86_64 x86_64 GNU/Linux
Mono JIT compiler version 2.6.7 (tarball Mon Jul 19 18:28:58 UTC 2010)


HTH
Karolo

-- 
View this message in context: http://mono.1490590.n4.nabble.com/Command-line-parameters-with-spaces-tp3228447p3228687.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list