Next Previous Contents

79. system

Synopsis

Execute a shell command

Usage

Integer_Type system (String_Type cmd)

Description

The system function may be used to execute the string expression cmd in an inferior shell. This function is an interface to the C system function which returns an implementation-defined result. On Linux, it returns 127 if the inferior shell could not be invoked, -1 if there was some other error, otherwise it returns the return code for cmd.

Example

    define dir ()
    {
       () = system ("DIR");
    }
displays a directory listing of the current directory under MSDOS or VMS.


Next Previous Contents