Find Jobs
Hire Freelancers

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

$30-100 USD

Cancelado
Publicado hace más de 13 años

$30-100 USD

Pagado a la entrega
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.
ID del proyecto: 2978395

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 13 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
1 freelancer está ofertando un promedio de $43 USD por este trabajo
Avatar del usuario
See private message.
$42,50 USD en 14 días
5,0 (100 comentarios)
5,6
5,6

Sobre este cliente

Bandera de UNITED STATES
Bellevue, United States
5,0
128
Forma de pago verificada
Miembro desde oct 24, 2004

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.