|
#1
|
|||
|
|||
![]()
Hello there,
i am looking on the console output in a loop Code:
vWaitFors = Array(":&>", _ "#", _ "@", _ ">") Do If crt.Screen.WaitForStrings(vWaitFors) Then Set objTab = crt.GetScriptTab() nRow = objTab.Screen.CurrentRow szPrompt = objTab.screen.Get(nRow, 0, nRow, objTab.Screen.CurrentColumn - 1) If reNhop.Test(szPrompt) = True Then Is there any way to check not basic strings (like "#" for example), but regular expression (like "^(\w+)#" - enable mode on cisco) ?? Many thank for replies |
#2
|
|||
|
|||
Hi kammmo,
That functionality is not available at this time. I have added this thread to a feature request in our product enhancement database to add regular expression support to scripting in WaitForString() and WaitForStrings(). Should a future release of SecureCRT include this feature, notification will be posted here. If you prefer direct email notification, send an email to support@vandyke.com and include Feature Request - Forum Thread #13899 in the subject line or use this form from the support page of our website.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Hi Brenda.
THanks for fast reply. ![]() Is there any way how to check the CurrentRow in 1 sec intervals?? When i am doing it in loop, the output is just not showing on screen as script is blocking it. BR Kamil |
#4
|
|||
|
|||
Hi Kamil,
What version of SecureCRT are you using? You can add a one second sleep (crt.sleep 1000), but without knowing your overall objective, I am not sure that is the most efficient handling of the issue. I only have a very narrow perspective of your script. What are you trying to achieve? Quote:
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Hi Brenda,
Version 8.5.3 (x64 build 1867) script is pretty simple. I am checking "CurrentRow" of active session. In this row i am checking beginning of the row. I am trying to recognize this string and decide, if i am in enable mode or privilege mode on Cisco device. Switch> --> enable mode Switch# --> privilege mode So the differences is only in one symbol ( > vs # ). So i am looking on the CurrentRow in a loop, with condition as i wrote Code:
vWaitFors = Array("#", _ ">") If crt.Screen.WaitForStrings(vWaitFors) Then This process is pretty slowly when your output has lot of "#" (for example some comments). It is processed on each "#". I wanted to add there regular expression (like "^(\w+)#"). You said the it is not supported now. So i just want to check CurrentRow only each second. I cannot do it in loop as i am checking each "#" all the time. When i apply "sleep", the console output is not displaying output in real time on the screen, and it is freezed during this 1 second. Output is like blocked in some way. It is not usable. So is there any way how to check "CurrentRow" in second interval, and do not block output on the screen?? Hopefully i explained it understandable. BR, Kamil |
#6
|
|||
|
|||
Hi kammmo,
Quote:
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
cisco , regular expression , waitforstrings |
Thread Tools | |
Display Modes | Rate This Thread |
|
|