Description

This article provides information on how to send quotation mark and vertical line in the Secure CRT script.

Symptoms

At times, we need to filter some of the output from the command line interface of JunOS in a SecureCRT script. For example:

root@router# run show configuration | display set | match "lab" 

Solution

You can use either a double quote " or Chr(34) to accomplish this. Chr(124) is the equivalent of vertical line | . Note that Chr(13) refers to  Enter CR/.

In the SecureCRT script:

#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

Sub Main
 crt.Screen.Send "run show configuration " & chr(124) & " display set " & chr(124) & " match " & chr(34) & "lab" & chr(34) & chr(13)


End Sub

*************************

Above script generates the output below:

root@router# run show configuration | display set | match "lab" 
set system login user labroot uid 2001
set system login user labroot class super-user
set system login user labroot authentication encrypted-password "$ABC123"

Modification History

2019-10-22: Updated to fit all Junos. Removed from archive.
2019-09-07:  Archived article.

Related Information