2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: SYSTEM, system, system call
10 SYSTEM --- Execute a shell command
11 **********************************
13 .. function:: SYSTEM(COMMAND)
15 Passes the command :samp:`{COMMAND}` to a shell (see ``system(3)``). If
16 argument :samp:`{STATUS}` is present, it contains the value returned by
17 ``system(3)``, which is presumably 0 if the shell command succeeded.
18 Note that which shell is used to invoke the command is system-dependent
19 and environment-dependent.
22 Shall be of default ``CHARACTER`` type.
25 (Optional) Shall be of default ``INTEGER`` type.
34 .. code-block:: fortran
36 CALL SYSTEM(COMMAND [, STATUS])
37 STATUS = SYSTEM(COMMAND)
40 :ref:`EXECUTE_COMMAND_LINE`, which is part of the Fortran 2008 standard
41 and should considered in new code for future portability.