Next: , Previous: SymLnk Intrinsic (function), Up: Other Intrinsics


10.5.2.132 System Intrinsic (function)

     System(Command)

System: INTEGER(KIND=1) function.

Command: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: badu77.

Description:

Passes the command Command to a shell (see system(3)). Returns the value returned by system(3), presumably 0 if the shell command succeeded. Note that which shell is used to invoke the command is system-dependent and environment-dependent.

Due to the side effects performed by this intrinsic, the function form is not recommended. However, the function form can be valid in cases where the actual side effects performed by the call are unimportant to the application.

For example, on a UNIX system, `SAME = SYSTEM('cmp a b')' does not perform any side effects likely to be important to the program, so the programmer would not care if the actual system call (and invocation of cmp) was optimized away in a situation where the return value could be determined otherwise, or was not actually needed (`SAME' not actually referenced after the sample assignment statement).

For information on other intrinsics with the same name: See System Intrinsic (subroutine).