1*61180Sbostic.\" Copyright (c) 1990, 1991, 1993 2*61180Sbostic.\" The Regents of the University of California. All rights reserved. 320376Smckusick.\" 450332Sbostic.\" This code is derived from software contributed to Berkeley by 550332Sbostic.\" the American National Standards Committee X3, on Information 650332Sbostic.\" Processing Systems. 750332Sbostic.\" 842122Sbostic.\" %sccs.include.redist.man% 942122Sbostic.\" 10*61180Sbostic.\" @(#)system.3 8.1 (Berkeley) 06/04/93 1142122Sbostic.\" 1248349Scael.Dd 1348349Scael.Dt SYSTEM 3 1448349Scael.Os 1548349Scael.Sh NAME 1648349Scael.Nm system 1748349Scael.Nd pass a command to the shell 1848349Scael.Sh SYNOPSIS 1948349Scael.Fd #include <stdlib.h> 2048349Scael.Ft int 2148349Scael.Fn system "const char *string" 2248349Scael.Sh DESCRIPTION 2348349ScaelThe 2448349Scael.Fn system 2548349Scaelfunction 2648349Scaelhands the argument 2748349Scael.Fa string 2842122Sbosticto the command interpreter 2948349Scael.Xr sh 1 . 3048349ScaelThe calling process waits for the shell 3148349Scaelto finish executing the command, 3248349Scaelignoring 3348349Scael.Dv SIGINT 3448349Scaeland 3548349Scael.Dv SIGQUIT , 3648349Scaeland blocking 3748349Scael.Dv SIGCHLD . 3848349Scael.Pp 3942122SbosticIf 4048349Scael.Fa string 4148349Scaelis a 4248349Scael.Dv NULL 4348349Scaelpointer, 4448349Scael.Fn system 4542122Sbosticwill return non-zero if the command interpreter 4648349Scael.Xr sh 1 4742122Sbosticis available, and zero if it is not. 4848349Scael.Pp 4948349ScaelThe 5048349Scael.Fn system 5148349Scaelfunction 5242122Sbosticreturns the exit status of the shell, or \-1 if the 5348349Scael.Xr wait 3 5442122Sbosticfor the shell failed. 5548349ScaelA return value of 127 means the execution of the shell 5642122Sbosticfailed. 5748349Scael.Sh SEE ALSO 5848349Scael.Xr sh 1 , 5948349Scael.Xr execve 2 , 6048349Scael.Xr wait 2 , 6148349Scael.Xr popen 3 6248349Scael.Sh STANDARDS 6348349ScaelThe 6448349Scael.Fn system 6548349Scaelfunction 6648349Scaelconforms to 6748349Scael.St -ansiC . 68