Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-24-2008, 10:37 AM
sagi2002 sagi2002 is offline
Registered User
 
Join Date: Apr 2008
Posts: 3
send an esc to vi or Crt.Screen.Send(27)

Hi all ,
I'm tring to crate a script that edit a vi file under linux .
i need to now how to send ESC to the vi or Crt.Screen.Send(27).
i am using securecrt 6.1 .
if any one can help whit a sample or how to.
Thanks all
Reply With Quote
  #2  
Old 04-24-2008, 11:16 AM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hi sagi2002,

Does the following line help you to send an 'ESC' to the remote?

Code:
crt.Screen.Send chr(27)
Reply With Quote
  #3  
Old 04-24-2008, 11:44 AM
sagi2002 sagi2002 is offline
Registered User
 
Join Date: Apr 2008
Posts: 3
thanks

Yes it work's , can you also help me whit a wait command or sleep it doesn't seems to get the sleep command.
Thanks
Reply With Quote
  #4  
Old 04-24-2008, 12:45 PM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hi sagi2002,

I am not sure I understand exactly what you would be waiting for or how long you should configure the script to sleep.

Could you post the section of your code that you wish to add waits or sleeps to?

Also, please explain why you would like to add a wait or sleep function to your code.
Reply With Quote
  #5  
Old 04-24-2008, 01:36 PM
sagi2002 sagi2002 is offline
Registered User
 
Join Date: Apr 2008
Posts: 3
thanks Again

i need to wait until the vi is exit and to reboot , but using crt.Screen.WaitForString is not working good for me .
is there any way else to wait like watting 5 second or 10 second and the do the next command
Reply With Quote
  #6  
Old 04-24-2008, 01:59 PM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hi sagi2002,

You could use 'crt.Sleep 5000' to sleep for 5 seconds, however a more reliable method would be to use the crt.Screen.WaitForString method.

Could you explain more about how WaitForString is failing?
My vision of your implementation of a WaitForString call would be to wait for the prompt to appear (thus indicating that vi is closed), and then issuing the shutdown command.
Also, please be aware that shutting the remote system down will terminate the connection, and thus terminate the script execution (if a WaitForString(), Send(), or any other operation is attempted that requires an active connection).

Last edited by jdev; 04-24-2008 at 02:09 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:25 PM.