in reply to Re: Run Shell script followed by ctrl-c within perl
in thread Run Shell script followed by ctrl-c within perl

My issues is, iam trying to automate a download process , in which iam supposed to call the script which i mentioned

more information on shell script is as below

it requires 2 inputs , so when i call this script, i need to the output in screen to key in the inputs

regarding ctrl-c termination, it will display status at the end as download completed and remains idle, unless we press ctrl-c it wont come out from the script.

i have no right to modify shell script, so iam thinking alternatives to be considered in perl

if i fork a child process which can run shell script and upon clicking ctrl-c if child process terminates and returns to parent , it would solve my pupose , but iam not sure if this supports in perl

  • Comment on Re^2: Run Shell script followed by ctrl-c within perl

Replies are listed 'Best First'.
Re^3: Run Shell script followed by ctrl-c within perl
by colwellj (Monk) on Nov 25, 2009 at 23:09 UTC
    If you want to automate the script then you want to steer AWAY from user input/output so you don't want to click anything.
    Look at passing the inputs to your shell script from perl.
    If you have a very interactive shell script you will need to capture the output of the script in perl and have a conversation with it.
    Have a look at backticks in the perl manual or qx//;
    As keszler said IPC::Run seems your best bet for an interactive relationship.