hostsick.blogg.se

How to use telnet in shell script background
How to use telnet in shell script background









how to use telnet in shell script background
  1. #HOW TO USE TELNET IN SHELL SCRIPT BACKGROUND CODE#
  2. #HOW TO USE TELNET IN SHELL SCRIPT BACKGROUND FREE#
  3. #HOW TO USE TELNET IN SHELL SCRIPT BACKGROUND WINDOWS#

It appears that a script component could be written based upon Microsoft's Winsock control, the free SocketWrench control from Catalyst, or any of several other free Winsock controls. Dart, Distinct, and Catalyst are well-known brands. There are several commercial Telnet components however. But as I said, the ones above are either just fancy Winsock components in some cases, or possibly just what you need (but hard to figure out quickly) in other cases. Otherwise you will need to do this via some ActiveX component. Your best bet might indeed be some 3rd party scriptable Telnet application, if you aren't set on running things from a WSH script. Might be great, but I haven't the patience to decipher them right now. Other show some promise (such as the one referenced at the dbforums link above), but clearly were written by a non-native English speaker and have nearly unintelligible documentation. Some of the tools at the links above are downright ludricrous (they don't seem to have any idea what Telnet really is). I found another "telnet" program at SourceForge called "Console Telnet" or "Telnet-Win32" (aliases) that promises this capability, but in my tests fails miserably to deliver.

how to use telnet in shell script background

The big problem you have is that the telnet.exe supplied by Microsoft does not do its console I/O via stdin and stdout. Some of the alternatives listed look interesting, but in many ways they fall short. RE: Automating a telnet session dougcranston (TechnicalUser) 9 Dec 03 10:13 According to the documentation Exec does indeed have a StdIn but I can not get it to work.

how to use telnet in shell script background

#HOW TO USE TELNET IN SHELL SCRIPT BACKGROUND CODE#

However, when using Exec my telnets behave like they are exiting before the next line of code in the script can be executed. Exec seems like the only method that will allow collection of the output. OShell.Sendkeys "INTERFACE STATISTICS 13"įrom pretty much all the documentation I found Run seems only useful for commnand line macros since it can not do anything with the output. I tried several different ways to pull the Standard Output but all of them generated errors.

#HOW TO USE TELNET IN SHELL SCRIPT BACKGROUND WINDOWS#

However, according to the MS Windows 2000 Scripting Guide the Run method CAN NOT retrieve output from a Command-Line tool. The following code works for communicating with the switch.

how to use telnet in shell script background

VBScript however is being troublesome with this.Īfter reading over the link I decided to give Run a shot again. Inside repeat.sh put the following, changing the appropriate values based upon the HTTP commands you want to send to your host, etc.I've done it with perl scripting in hp unix once upon a time. I am running the the staff's web server locally on 192.168.56.101:8080. You will also want to make repeat.sh executable. I stored it on the desktop for this example. Save that file somewhere on your computer. This is the file that is going to store the commands in it that we are wanting to repeat. The first step is to create a file named repeat.sh. My first thought is, how can I automate this to make it easier to repeat these commands test by web server out, like a beast? Well, a few quick Google searches later and I found a great solution to my problem on Stackoverflow. I can't easily repeat the HTTP request because the commands are not being entered in Bash but in the telnet program itself. I get to a point in the instructions where I need to enter commands into command line program telnet to test that my web server is returning what I expect. So I am working on CS50's Problem Set 6: Web Server where I am asked to implement my own web server in C. Date Sun 01 November 2015 Modified Sun 01 November 2015 Tags Bash











How to use telnet in shell script background