[Gambas-user] Problem with SHELL command.Please help!!

Stefano Palmeri rospolosco at ...152...
Fri Feb 1 15:33:13 CET 2008


Alle 14:44, venerdì 1 febbraio 2008, Mukul Khullar ha scritto:
> I am trying to use the SHELL command in gambas for executing a command
> known as auditctl on my GUI such as :
>
> SHELL fk TO s
>
> where fk is the command auditctl [flags]
>
> and s is a variable of type variant.
>
> When I give the correct flags, the output from the shell is returned
> correctly in s, and I can print s using message(s).
> But when I give an incorrect combination of flags , the error returned on
> the shell is not coming into s(on debugging, s remains blank, nothing is
> returned into s).
> How can I redirect any type of shell output of the above command into some
> variable? Is there a better way to do it?
> Any help would be highly appreciated.
> Thanking you,
> Mukul Khullar.

Try to add "2>&1" at the end of your SHELL command, i.e.:

DIM sShellOutput as String

SHELL "cat non_existent_file 2>&1" TO sShellOutput 

Stefano

> -------------------------------------------------------------------------
> 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/listinfo/gambas-user




More information about the User mailing list