Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
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:

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

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

    MsgBox strResult

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

Please advise.

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 07:29 PM.