Ron_1st ha scritto:
> On Tuesday 16 December 2008, wig wrote:
>   
>>  sImport = "< " & Application.Path & "/mytables.sql"
>>
>>  EXEC ["mysql", sUser, sPassword, sHost, sDatabase, sImport]
>>
>>     
>
>   sImport = "< "
>   sSqlFile = Application.Path & "/mytables.sql"
>
>   EXEC ["mysql", sUser, sPassword, sHost, sDatabase, sImport, sSqlFile ]
>
> Every item on the line for EXEC should be a seprate item in the array.
> The "<" is a seperate item/part of the line, it has space on both adjacent 
> sides!
>   
No,

the "<" construct is a shell construct, not a linux/unix one. It is 
/bin/sh, or whatever, which interprets this notation and does a lot of 
job about it.
The gambas SHELL instruction calls /bin/sh, which is powerful 
(environment, PATH search, redirection and much more), so you can use 
all its features.

EXEC calls the unix system call execXX() (there are various) which are 
faster but not as powerful as /bin/sh.

I think the most notably differences are:
1. Using SHELL you specify the command to execute as you would do on the 
command line. ls is ls, and fdisk is fdisk. In EXEC, you *must* specify 
the correct path: /bin/ls, /sbin/fdisk... - Linux won't search the file 
for you. EXEC ["mysql", ...] can not work.

2. Again, parameters and constructs of SHELL are the same as those in 
the command line; you can use < > | and so on, and must quote words 
which contain spaces and other special chars. Using EXEC you don't have 
(well, you must not) quote parameters. and you don't have /bin/sh 
constructs.

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to