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 03-05-2020, 01:10 PM
automate automate is offline
Registered User
 
Join Date: Feb 2020
Posts: 2
Cisco show run int / show int

I frequently check the running configuration for ports by typing:

show run int interface

Following this I look at interface statistics for the same port by typing:

show int interface

How can I create a script that will take the last show run int command and repeat as a show int command for the same port?
Reply With Quote
  #2  
Old 03-05-2020, 02:57 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,005
Quote:
Originally Posted by automate View Post
I frequently check the running configuration for ports by typing:

show run int interface

Following this I look at interface statistics for the same port by typing:

show int interface

How can I create a script that will take the last show run int command and repeat as a show int command for the same port?
I probably wouldn't go the route of scripting.

Instead, I'd configure SecureCRT to enable the Copy on Select Global Option, and create buttons to send commands based on what's in the clipboard.

Here's how I'd create my buttons:

Here's how I'd enable SecureCRT to automatically copy to the clipboard whatever I select:

With such a configuration in place, I'd simply click the first button to show the interfaces...

...then I'd double-click the interface I was interested in (the easy way to select the word underneath the mouse cursor is to double-click it).

Because "Vlan1" now selected, it's also copied to the clipboard.
Knowing that what's in the clipboard is what I want to include in the next two commands (e.g. the \v portion), I'd then click my other two buttons in succession...

Low cost. High value. Time $aving$.

--Jake
Attached Images
File Type: png Forum14098_ButtonSetup.png (90.3 KB, 245 views)
File Type: png SCRT_GlobalOptions_Mouse_CopyOnSelect.png (31.6 KB, 249 views)
File Type: png Forum14098_ClickButton1.png (44.4 KB, 250 views)
File Type: png Forum14098_Select+CopyViaDoubleClick.png (43.9 KB, 253 views)
File Type: png Forum14098_ClickButton2.png (59.7 KB, 258 views)
File Type: png Forum14098_ClickButton3.png (74.6 KB, 254 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support

Last edited by jdev; 03-06-2020 at 08:59 AM.
Reply With Quote
  #3  
Old 03-19-2020, 01:18 PM
automate automate is offline
Registered User
 
Join Date: Feb 2020
Posts: 2
Thanks Jake!

I like your solution and the clear documentation. I created the buttons as you recommended. I also mapped keys to the same commands. Either way works great for running the commands on the clipboard content. The only problem that I had was when I tried to double click on the interface. I couldn't double click and select the interface as it's in the form of GigabitEthernet1/0/1. Double-clicking selects the content before the first forward slash. However, if I manually select the entire interface it works fine.

Shawn
Reply With Quote
  #4  
Old 03-19-2020, 01:32 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,005
Quote:
Originally Posted by automate View Post
I couldn't double click and select the interface as it's in the form of GigabitEthernet1/0/1. Double-clicking selects the content before the first forward slash.
Check out our word delimiters tip, or watch the copy and paste video (focus on :036 through the 1:23 mark) to see how you can change what a "word" is so your double-click activity can be more productive for you.

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
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 05:10 AM.