Passes a command to the operating system for execution. The current process pauses until the command is completed and control is returned from the operating system. An added, optional argument to the subroutine will allow recovery of any return code information from the operating system.
Subroutine
INTEGER ULIMIT
CHARACTER(32) CMD
…
! Check the system ulimit.
CMD = 'ulimit > ./fort.99'
CALL SYSTEM(CMD)
READ(99, *) ULIMIT
IF (ULIMIT .LT. 2097151) THEN
…
INTEGER RC
RC=99
CALL SYSTEM("/bin/test 1 -EQ 2",RC)
IF (IAND(RC,'ff'z) .EQ. 0) then
RC = IAND( ISHFT(RC,-8), 'ff'z )
ELSE
RC = -1
ENDIF
EXECUTE_COMMAND_LINE(COMMAND, WAIT, EXITSTAT, CMDSTAT, CMDMSG) (Fortran 2008)
See the system subroutine in the AIX® Technical Reference: Base Operating System and Extensions Volume 2 for details about the underlying implementation.