|
#1
|
|||
|
|||
2 questions: expect & shell scripting
I have a couple of questions/requests. Some variation of these may already be in place and I just don't know about it, so I'm asking.
First, is it possible to set up some kind of a macro that will automatically run anytime a certain word is shown in a securecrt terminal? Right now I have vbs scripts set up to log me in to various servers and network devices. What would be nice is if "password:" came up on the screen, I could tell securecrt to automatically enter in a given password. This can be set to happen on initial login through the expect function in the session options, but I want it to happen each time the word comes up on the screen, not just upon initial login. Another terminal emulation program, ZOC, has the ability to do this, but I'd prefer to stick with securecrt since I've been an avid user for a couple of years now. Second, are there any plans in the future to incorporate any kind of unix/linux shell functionality into securecrt? Some sort of ability to write macros in a unix/linux type language (bash, ksh, rexx, or something of that nature). |
#2
|
||||
|
||||
Hi Devrick0,
It is possible to use a script to continuously scan for the password prompt or any other command. However, if this is used, it will not allow other scripts to be run. An example of this type of script would be: #$language = "VBScript" #$interface = "1.0" g_vWaitFors = Array("ssword:", _ "Waiting for 2", _ "Waiting for 3", _ "Waiting for 4", _ "Waiting for 5", _ "Waiting for 6", _ "Waiting for 7", _ "Waiting for 8", _ "Waiting for 9", _ "Waiting for 10") g_vRespondWiths = Array("this is my password", _ "Command 2", _ "Command 3", _ "Command 4", _ "Command 5", _ "Command 6", _ "Command 7", _ "Command 8", _ "Command 9", _ "Command 10") '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sub Main() 'crt.screen.Send "cat" & vbcr crt.screen.synchronous = true do nIndex = crt.screen.WaitForStrings(g_vWaitFors) crt.screen.send g_vRespondWiths(nIndex - 1) & vbcr Loop End Sub ====== Currently, we do not have support for macro funtions in SecureCRT. I have entered a feature request for the option that if macros are added, the macro could be automatically run on certain events (like 'password:' appearing on the screen). I have added this thread to that request. If you would prefer to be contacted by email instead, please send an email to support@vandyke.com with a subject of 'ATTN: Teresa Forum Thread 1110'. On your second request, could you provide me an example of a macro you would like to run? What behavior would you expect from this macro?
__________________
Thanks, Teresa Teresa Nygren |
#3
|
|||
|
|||
shell macros
Thanks for submitting the feature request.
As far as macros go, right now you can set up vbs scripts that will run once logged into machines. So for instance, I ssh into a solaris machine that is used as a jump point, and I set up various vbs scripts that will bring me to network devices or servers in the environment. Then the vbs executes x y and z. Rather than having to write a vbs script, I'd like the ability to write a shell script (bash, korn, etc.), that's saved on my local machine, and have securecrt execute that script once it gets to the machine, or once it sees a certain prompt. We have a massive *nix/networking environment that we use securecrt in and every automated script we run is written as a shell script. Having to port those over to vbs is very time consuming. |
#4
|
||||
|
||||
Hi Devrick0,
If I understand correctly, you are needing SecureCRT to be able to run a shell script after connecting to the remote. Is that correct? This may be possible to perform by sending the command to run the shell script. However, the script would need to be present on the remote side. Is there another SSH2 client that has the option to run a shell script? How are you currently launching the shell scripts?
__________________
Thanks, Teresa Teresa Nygren |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|