Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How can I control interactive cli executables on Windows from Perl

by FitTrend (Pilgrim)
on Mar 30, 2005 at 15:29 UTC ( #443505=note: print w/ replies, xml ) Need Help??


in reply to How can I control interactive cli executables on Windows from Perl

I'm not sure you can accomplish this with Windows Telent. If you do a telnet /? from the command line, you'll notices theirs no way to pass a list of commands like you can with FTP. This will make it difficult to accomplish what you want without using a module. Is there a particular reason why you can't use any telnet modules?


Comment on Re: How can I control interactive cli executables on Windows from Perl
Re^2: How can I control interactive cli executables on Windows from Perl
by apprentice (Scribe) on Mar 30, 2005 at 15:37 UTC
    Hi Marc,

    I don't want to just fire off a command, I need to 'interactively' control the executable that I launch. It is not limited just to telnet, though I thought that would be a good example.

    As to the why, many of these executables do not have modules and the requirements I have been given are to test the executables under certain conditions, not to write my own perl apps and test them.


    "Peace, love, and Perl...well, okay, mostly just Perl!" --me

    Apprentice

      I understand. Since that is the case, here is what I recommend.

      You can use two additional methods not already talked about above. first one is the system command which will allow you to execute commands to the exe and wait for completion.

      system ("$ENV{'WINDIR'}\\system32\\telnet 10.1.1.10"); # OR ANY EXE AN +D PARAMETERS

      Otherwise, you can use the backtick to take the output of a command and place it into a variable.

      $test = `dir c:\\`; print scalar $test;

      You can dump the output of system into a variable as well. Hope this helps

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://443505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (16)
As of 2014-12-22 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (123 votes), past polls