[Overview][Constants][Types][Procedures and functions][Variables][Index] |
Execute and feed command to system shell
Source position: line 0
function Shell( |
const Command: String |
):cint; |
const Command: AnsiString |
):cint; |
Shell invokes the bash shell (/bin/sh), and feeds it the command Command (using the -c option). The function then waits for the command to complete, and then returns the exit status of the command, or 127 if it could not complete the FpFork or FpExecve calls.
Extended error information is returned by the FpGetErrno function:
|
Pipe file to standard input/output of program |
|
|
Execute and feed command to system shell |
|
|
Create child process |
|
|
Execute process using environment |
program example56; uses Unix; { Program to demonstrate the Shell function } Var S : Longint; begin Writeln ('Output of ls -l *.pp'); S:=Shell ('ls -l *.pp'); Writeln ('Command exited wwith status : ',S); end.
lazarus-ccr.sourceforge.net |