How do you execute one program from within another in unix

How do you execute one program from within another in unix

Question :How do you execute one program from within anotherin unix?
Answer :The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs. execlp(path,file_name,arguments..); //last argument must be NULL A variant of execlp called execvp is used when the number of arguments is not known in advance. execvp(path,argument_array); //argument array should be terminated by NULL
Keywords:
return value from one shell script to another
how to pass variable from one function to another in shell script
bash function call another function
calling functions in shell script
unix function with argument
bash function run command
write function in unix
factorial program in shell script using function

No comments: