Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

system(3f) [bsd man page]

SYSTEM(3F)																SYSTEM(3F)

system - execute a UNIX command SYNOPSIS
integer function system (string) character*(*) string DESCRIPTION
System causes string to be given to your shell as input as if the string had been typed as a command. If environment variable SHELL is found, its value will be used as the command interpreter (shell); otherwise sh(1) is used. The current process waits until the command terminates. The returned value will be the exit status of the shell. See wait(2) for an explanation of this value. FILES
/usr/lib/libU77.a SEE ALSO
exec(2), wait(2), system(3) BUGS
String can not be longer than NCARGS-50 characters, as defined in <sys/param.h>. 4.2 Berkeley Distribution May 15, 1985 SYSTEM(3F)

Check Out this Related Man Page

system(3)						     Library Functions Manual							 system(3)

system - Executes a shell command LIBRARY
Standard C Library (, libc.a) SYNOPSIS
#include <stdlib.h> int system( const char *string); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: system(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies a valid sh shell command. If string is NULL (0), the system() function tests the accessibility of the sh command interpreter. If string is not NULL, the system() function passes the parameter to the sh command, which interprets string as a command and exe- cutes it. DESCRIPTION
The system() function passes the string parameter to the sh command, which interprets string as a command and executes it. The system() function invokes the fork() function to create a child process that in turn uses the exec function to run sh, which interprets the shell command contained in the string parameter. The current process waits until the shell has completed before returning. RETURN VALUES
If the string parameter is NULL, the system() function returns 0 if it is unable to access the command interpreter or a non-zero value if sh is accessible. If the string parameter is not NULL, upon successful completion by sh, the system() function returns the exit status of the shell process in the form that wait(2) returns. Otherwise, the system() function returns a value of -1 and sets errno to indicate the error. Exit status 127 indicates that the shell could not be executed. Note that the exit status should only be interpreted using the macros described in wait(2) and defined in the sys/wait.h header file. ERRORS
The system() function sets errno to the specified values for the following conditions: The status of the child process created by system() is no longer available. In addition, the system() function may set errno values as described by fork(). RELATED INFORMATION
Functions: exec(2), exit(2), fork(2), wait(2) Commands: sh(1) Standards: standards(5) delim off system(3)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Information about Unix System Administration

I'm a newbie so I'm not sure if I'm posting this in the right section... if I didn't, please forgive me :) I've been looking all over the web for information on system administration. I'd like to become a Unix System Administrator but I want to find some more info about the job. Can someone please... (54 Replies)
Discussion started by: hpicracing
54 Replies

2. Filesystems, Disks and Memory

QEMU not booting my image

hello all, I have been trying to boot an image (.IMG) using qemu, for quite some time now and i can't seem to get it to work. I've been able to boot from the Windows XP CD, the Debian iso image, etc, so I know qemu is configured properly and is working. But when it come to booting an image that I... (34 Replies)
Discussion started by: neur0n
34 Replies

3. What is on Your Mind?

What do you do for a living?

(107 Replies)
Discussion started by: ilikecows
107 Replies

4. UNIX for Beginners Questions & Answers

How Do I FTP System Files to Different Server?

Hello, I have a legacy system that is running on SCO OpenServer 5.0.6, and the hardware is becoming a little sketchy. I replaced the hard drive about a year ago, and was able to come back from a tape backup of my entire system. I have been successful with building a VM with VMware Workstation,... (42 Replies)
Discussion started by: spock9458
42 Replies

5. What is on Your Mind?

New Badging System - Badges Prototype Beta 1 (Badges Only)

Today I mapped out the new badging system using FA icons, Beta 1 in no particular order except a 6 x 8 grid: The prototype HTML code for this layout: <style> .fa-badge-grid { font-size: 1.5em; } .row { ... (38 Replies)
Discussion started by: Neo
38 Replies

6. Web Development

Notes with Ravinder on Badging System Development Part II

Part II: Current PHP file Beta 73 Not Optimized: <?php $version = 73; $query = "SELECT * FROM " . TABLE_PREFIX . "user WHERE userid='" . $uid . "'"; $usertable = $db->query_read_slave($query); $modaluser = $db->fetch_array($usertable); $modaluser = gmdate("d F Y", $modaluser); $modaluser... (48 Replies)
Discussion started by: Neo
48 Replies

7. Open Source

What is your favorite Linux distro?

What is your favorite Linux distro? and possibly why? Personally, I have Fedora 3 on my computer. I have used Ubuntu and Slackware, too. But I think I liked Ubuntu more, maybe because of its speed and easy installation of packages. (192 Replies)
Discussion started by: milhan
192 Replies

Featured Tech Videos