Archive for December 17th, 2008

Hoe een shell commando uitvoeren

EXEC start een extern process. SHELL start een extern command in een shell.
Bij EXEC geef je de parameters allemaal als parameter mee. Bij SHELL geef je een string met het hele commando mee.
EXEC [ "ls", "-la", "/tmp"] WAIT SHELL "ls -la /tmp" WAIT
EXEC wordt uitgevoerd in ? SHELL wordt uitgevoerd in /home/username
Gebruik bv
Application.path & "/this.txt"
voor een bestand dat in het Gambas programma-pakket zit (directory)
Test bv met
DIM sReturnValue AS String
SHELL "pwd" TO sReturnValue
DEBUG sReturnValue