VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Cisco show run int / show int (https://forums.vandyke.com/showthread.php?t=14098)

automate 03-05-2020 01:10 PM

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?

jdev 03-05-2020 02:57 PM

6 Attachment(s)
Quote:

Originally Posted by automate (Post 53141)
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:
https://forums.vandyke.com/attachmen...achmentid=1839

Here's how I'd enable SecureCRT to automatically copy to the clipboard whatever I select:
https://forums.vandyke.com/attachmen...achmentid=1840

With such a configuration in place, I'd simply click the first button to show the interfaces...
https://forums.vandyke.com/attachmen...achmentid=1841

...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).
https://forums.vandyke.com/attachmen...achmentid=1842
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...
https://forums.vandyke.com/attachmen...achmentid=1843
https://forums.vandyke.com/attachmen...achmentid=1844

Low cost. High value. Time $aving$.

--Jake

automate 03-19-2020 01:18 PM

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

jdev 03-19-2020 01:32 PM

Quote:

Originally Posted by automate (Post 53201)
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


All times are GMT -6. The time now is 06:39 AM.