.\" @(#)system.3f 1.3 89/01/27 SMI; from UCB 4.2 .TH SYSTEM 3F "07 July 1995" .SH NAME system \- execute operating system command .SH SYNOPSIS .\" .IX system "" \fLsystem\fP .IX "execute a SunOS command" .IX "command, execute a SunOS command" .IX "sunos, execute a sunos command" "" "SunOS, execute a SunOS command" .\" .B integer function system (string) .br .B character*(*) string .SH DESCRIPTION The function .B system gives .I string to your shell as input, as if the string had been typed as a command. If the environment variable .B SHELL is found, its value is used as the command interpreter (shell); otherwise, .BR sh (1) is used. .PP The current process waits until the command terminates. The returned value is the exit status of the shell. See .BR wait (2) for an explanation of this value. .PP Historically, .B cc and .B f77 developed with different assumptions: .in +2 .sp .2 If .B cc calls .BR system , the shell is always the Bourne shell. .sp .2 If .B f77 calls .BR system , which shell is called depends on the environment variable .BR SHELL . .in -2 .PP The .B system function flushes all open files. .PP For output files, the buffer is flushed to the actual file. .PP For input files, the position of the pointer is unpredictable. .PP The .B system function is not MT-safe. Do not call it from FORTRAN MP programs. .SH FILES .B libF77.a .SH "SEE ALSO" .BR execve (2), .BR wait (2), .BR system (3) .SH BUGS .I string cannot be longer than 1023 characters. .SH SEE ALSO .BR sh (3F)