home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SYSTEM(3) MINTLIB LIBRARY FUNCTIONS SYSTEM(3)
-
-
- N✓NA✓AM✓ME✓E
- system - execute a command, passed a string
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- int system(const char *cmd);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- system executes the command in the string, and waits until
- it terminates.
-
- The first word in the string is the name of the program to
- be executed; this program is searched in the current
- directory and on the directories set in the environment
- variable PATH. The normal extensions ".ttp", ".tos" and
- ".prg" are tried when the program is being searched.
-
- If the rest of the string contains unquoted '<' or '>'
- characters, standard input or standard output for the com-
- mand to be run is redirected to the file with the filename
- following the '<' or '>'.
-
- The remaining part of the string is passed to the program
- as a command line.
-
- This routine is implemented using spawnvp.
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- system(NULL) returns 1 as an indication system is sup-
- ported.
-
- When a valid command line is passed, system returns:
- -1 when out of memory.
- 2 when the redirection of stdin or stdout fails. The
- return value of the program called when successful.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- s✓sp✓pa✓aw✓wn✓nv✓vp✓p(✓(3✓3)✓),✓, e✓ex✓xe✓ec✓cv✓ve✓e(✓(3✓3)✓),✓, p✓po✓op✓pe✓en✓n(✓(3✓3)✓)
-
- N✓NO✓OT✓TE✓E
- On UN*X systems, this starts up the shell /bin/sh as a
- child process. The shell executes the command passed to
- system. Thus, on UN*X systems, one can pass a more com-
- plicated command line to system, for instance one contain-
- ing pipes or shell scripts. This may cause some problems
- when porting UN*X programs to the Atari.
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-