DESCRIPTION system() executes a command specified in string by calling /bin/sh -c string, and returns after the command has been completed. During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.
RETURN VALUE The value returned is -1 on error (e.g. fork failed), and the return status of the command otherwise. This latter return status is in the format specified in wait(2). Thus, the exit code of the command will be WEXITSTA TUS(status). In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127). ...
grep er bedre hvis man ikke kender funktionsnavnet.
[arne@arne2 arne]$ grep command /usr/include/std*.h /usr/include/stdio.h:/* Create a new stream connected to a pipe running the giv/ /usr/include/stdio.h:extern FILE *popen (__const char *__command, __const char ; /usr/include/stdlib.h:/* Execute the given line as a shell command. */ /usr/include/stdlib.h:extern int system (__const char *__command) __THROW;
ja det kan jeg se.. ovenstående virker også fint hos mig, både på en BSD boks, Suse og en Debian :)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.