8.238 SYSTEM — Execute a shell command
- Description:
- Passes the command COMMAND to a shell (see
system(3)). If argument STATUS is present, it contains the value returned bysystem(3), which is presumably 0 if the shell command succeeded. Note that which shell is used to invoke the command is system-dependent and environment-dependent.This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.
Note that the
systemfunction need not be thread-safe. It is the responsibility of the user to ensure thatsystemis not called concurrently. - Standard:
- GNU extension
- Class:
- Subroutine, function
- Syntax:
-
CALL SYSTEM(COMMAND [, STATUS])STATUS = SYSTEM(COMMAND) - Arguments:
-
COMMAND Shall be of default CHARACTERtype.STATUS (Optional) Shall be of default INTEGERtype. - See also:
- EXECUTE_COMMAND_LINE, which is part of the Fortran 2008 standard and should considered in new code for future portability.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/SYSTEM.html