Find Jobs
Hire Freelancers

perl script that interacts with another (launches, enters input, etc.)

$30-100 USD

Cancelled
Posted over 13 years ago

$30-100 USD

Paid on delivery
I have one script, call it [login to view URL], which prints the following output (everything inside square brackets "[]" is not really part of the output): *** Hello world. Let me think for five seconds... [pauses for five seconds] OK. Do you want to continue? Enter y or n. [user has to enter "y" before the script can continue] OK, thanks. Script doesn't actually do anything, so quitting now! *** I want a second script that "harnesses" the first script -- it should launch the first script, read its output and print its output to me, and enter "y" when prompted so that the script keeps running. Also, the second script should print the output of the first script *as it's running* -- in other words, not wait until the entire script is finished before printing its output. (This is what the "wait five seconds" part is for -- I want to make sure that the second script prints the beginning output of the first script, then waits five seconds, etc. -- that the second script does not wait until the first script is entirely finished.) Of course I'm going to modify the script to do more useful things after that, so it's nice if the code is readable :) I just don't know how to write the basic code that reads output of another script and interacts with it. ## Deliverables The description covers basically everything that I want, just a few points to be clear on: - before entering "y" in response to the first script, the second script should check that the prompt *exactly* matches the string "OK. Do you want to continue? Enter y or n.". I don't want the script to get some *other* prompt, and blindly respond "y" to something I didn't intend to answer. - the script should verify that the very last line of output from the first script, matches one of several "expected" strings, like "OK, thanks. Script doesn't actually do anything, so quitting now!" or "Nothing to do". So that if anything else is produced as the last line of output, the second script outputs an error and quits. - If anything unexpected happens (e.g. the first script generates a prompt that the second script was not expecting, or the last lines of output are something unexpected), the second script should quit with an error describing what went wrong and why it quit. ## Platform This should run on CentOS 5 with Perl 5.8.8, although presumably the code will be portable enough to work with most Linux perl installations.
Project ID: 2978395

About the project

1 proposal
Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $43 USD for this job
User Avatar
See private message.
$42.50 USD in 14 days
5.0 (100 reviews)
5.6
5.6

About the client

Flag of UNITED STATES
Bellevue, United States
5.0
128
Payment method verified
Member since Oct 24, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.