[Gambas-user] Hours of strugglin with EXEC and SHELL (Solved -sort of)

Fabien Bodard gambas.fr at ...626...
Fri Jan 25 14:24:23 CET 2008


Le Friday 25 January 2008 08:36:21 Ron Onstenk, vous avez écrit :
> On Friday 25 January 2008 04:13, richard terry wrote:
> > 2008-01-25 04:13
> >    
> > Probably not the way one should do it but RTFM came in handy again:
> >
> > At the end of the day I re-read the zip command again and realised I can
> > add a "-d /dir_where_I_want_to_put_my_files" to the end of the command
> > and this works ok, so I'll continue down my odyssey.
> >
> > Regards
> >
> > Richard
>
> That is the easy way.
> Every SHELL command runs in a fresh shell.
> If you need all commands to run in a defenied directory you need
>
> to prefix all those commandd with the CD <directory>; as in:
> > > SHELL "cd  /home/richard/coding; ls -al" WAIT
>
> i.e. SHELL "cd " & executepath & "; " & your_final_command" WAIT
>
> Ron
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listihnfo/gambas-user

the better is to include.. in hard the path... in your case, the cd command is 
not usefull

:

Dim sMyBasePath, sResult as String

sMyBasePath = "/home/richard/coding"

Shell "ls al " & sMyBasePath AS sResult

Print sResult



or

EXEC ["ls", "al", sMyBasePath] as sResult

Print sResult

No need of process too...

You have this too... (in gambas keywords)

Print Dir(sMyBasePath).Join("\n")




More information about the User mailing list