Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: exec & system

by sundialsvc4 (Abbot)
on Jul 21, 2018 at 13:32 UTC ( #1219004=note: print w/replies, xml ) Need Help??


in reply to exec & system

In Unix/Linux parlance, system executes a command in a child-process and waits for it to complete.   Whereas exec replaces the current process with the one specified.

For instance, I have used exec in a so-called “trampoline script” to support a hoary old CGI program in a new environment.   The trampoline first sets up the environment, then replaces itself with the original program.   Having done its setup duties, the trampoline process disappears, but the original program is launched into the same, modified, environment.   The original program cannot detect (and of course, does not care) that it was not initially launched by the web-server.   A simple and effective “hack,” I think . . .

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1219004]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2019-12-15 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?