next up previous contents index
Next: SigAction Up: Functions and procedures Previous: SetPriority

Shell

   

Declaration:

Function Shell (Command : String) : Longint;

Description:

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 Fork or Execve calls.

Errors:

Errors are reported in LinuxError.

See also:

POpen, Fork, Execve, system (3)

Example
program example56;

uses linux;

{ 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.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998