Results 1 to 2 of 2
Dear All,
Even though I got a very good knowledge regarding Unix concepts,But I am not able to understand some concepts.EXEC functions are one of them I am not able ...
- 05-21-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 11
When to use EXEC functions
Dear All,
Even though I got a very good knowledge regarding Unix concepts,But I am not able to understand some concepts.EXEC functions are one of them I am not able to differentiate when to use which EXEC function and what is the real-time applications of this EXEC functions. Please provide some examples and tutorials to understand.
Regards,
Sri Anu.
- 05-21-2009 #2
If you mean the libc exec functions, these are just calls to the kernel to load a different program into the current process. If you want to give the new program a list of separate arguments, you use execl; if you want to give the arguments as an array, you use execv. The latter is better if you don't know exactly what arguments will be used at run time. execlp and execvp look for the new program on the command path; if you omit the p qualifier, you must supply a full path to the command.
The exec command in the shell does the same thing; it causes the process to stop running the shell script and run the named program instead."I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote