|
发表于 2004-5-7 12:48:32
|
显示全部楼层
主要不同在它们的返回值上:- system (LIST)
- Category: Process
- Return Value: SCALAR, the exit code of the system command that was executed.
- Definition: Executes LIST as an operating system call. The process to execute this command is forked and the script waits for the child process to return.
- Note
- To capture the output from a system call use a back-quoted string instead of system().
- system("ls -F /var > /tmp/t.tmp");
复制代码- exec (LIST)
- Category: Process
- Return Value: None.
- Definition: This fuNCtion passes control from the script to an external system command. There is no return from this call. Note that system() calls external commands and does return.
- exec("cat /etc/motd");
复制代码 |
|