Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-30-2021, 09:58 AM
BjoernH BjoernH is offline
Registered User
 
Join Date: Mar 2018
Posts: 55
crt.Screen.ReadString does not behave as expected

Good day.


I'm trying to initialize a variable by capturing the hostname from a server:

Code:
Sub Main
    crt.Screen.Send "uname -n" & vbCr
    crt.Screen.WaitForString vbCr

    strResult = crt.Screen.ReadString(":~#")

    MsgBox strResult

End Sub
The SecureCRT session reads:
Code:
CPU2:ibcx1105vm002ssc001:~# uname -n
ibcx1105vm002ssc001
CPU2:ibcx1105vm002ssc001:~#
The strResult in the MsgBox shows this:
Code:
ibcx1105vm002ssc001
□]□[0mCPU2:ibcx1105vm002ssc001
instead of only the hostname (ibcx1105vm002ssc001).




Please advise.


Bjoern
Reply With Quote
 

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 06:00 PM.