Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rexx to script interactive telnet session

Status
Not open for further replies.

mikepaterson

Vendor
Mar 15, 2004
1
GB
Some years ago I used a product called MAX/Enterprise (now owned by BMC Software and DEAD) MAX/Enterprise used UniRexx and had added some extensions to redirect STDIN and STDOUT to a connected Telnet session. In this manner you could connect to a remote server, wait for the login prompt (or a timeout) and then enter username, then wait for prompt, entaer password, wait for prompt, key command, wait for output, parse output and based on content decide what to do next. It was all very easy

ret=connect(server,port)
ret=waitfor("login>", 20) /*wait 4 login prompt/timeout */
If ret¬=1 then /* If we got prompt */
say "userid" /* type userid */
else .... /* error processing */

ret=waitfor("password>", 20) /*wait 4 pswd prompt/timeout*/
If ret¬=1 then /* If we got prompt */
say "password" /* type password */
else .... /* error processing */

ret=waitfor(">", 20) /*wait 4 cmd prompt/timeout */
If ret¬=1 then /* If we got prompt */
say "dir/w" /* issue command*/
else .... /* error processing */

do while lines() /* loop round data returned by cmd*/
parse pull data /* grab each line in turn */
etc. etc.
end

These extensions made it really easy to automate a telnet session. My question is : Is there any product or extension available today that allows this easy automation of telnet sessions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top