Hello fellow monks,
UPDATE:Thank you to all who replied. I got it working now. Unfortunately the ancient system I am running does not have Expect on it. I have been unsuccesful in previous attempts to get the sysadmins to add stuff for me. I know I *could* install it in my own directory (done that before too), but
moot's suggestion works without having to do that.
Thanks again to everyone.
I am having a little trouble figuring something out and I would appreciate any help you guys can give.
I am trying to put together a perl script to run a variety of different daily checks that I need to run at work. There are several different tools that I need to execute. All but one of them will accept and argument as input, (it is written in C and I don't have the source code to modify). When I call "comparepass.exe" it responds with a list of valid files to check. I already know the name of the file I want to check so I don't really need the list, but with no command line arguments available, I can't override this action.
I know in Net::Telnet, I can issue a command, then use
$prev = $obj->prompt($matchop); to change the prompt and issue another command.
If I use
system("comparepass.exe") or
@response=`comparepass.exe`; It simply executes the command without giving me a chance to change the prompt or anything and give a secondary input. I know there has to be a way to do this in perl, but I can't find it in my searching, any help would be greatly appreciated.
20050219 Edit by castaway: Changed title from 'Interacting with unix shell'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.