|No such thing as a small change|
How to "transfer control" to child process?by VingInMedina (Acolyte)
|on May 23, 2011 at 12:52 UTC||Need Help??|
VingInMedina has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to set up a program that will perform a set of user defined steps. Each step will be a seperate program, which could be anything (e.g. shell script, unix command, c++ program, perl program). My program will execute the specified command and check the return code. If the return code is 0, my program will move onto the next user defined step.
Here is my problem, any one of the specified steps could be a program that needs input from the user. What I want to do is have my program turn over control to the executed program (allowing the user to specify any necessary termial input) and return control back to me when it finishes. All I need from this is the return code of the executed process.
I've tried just using system() call, but that won't get STDIN from the user.
Here is my program so far (ScriptEngine.pl)
Here is a sample script to call this program
Here is the /tmp/thing script that asks for input
When it runs the /tmp/thing script I am not given the chance to enter the requested input