The Gathering Technical blog

Cisco: IOS Shell for 15.1(4)M, 15.1(2)S, and later releases.

27 Jan 2012, by Daniel Husand from

Looking through the feature navigator I stumbled upon the new IOS shell that has been integrated into IOS releases 15.1(4)M, 15.1(2)S and onward. Finally one might be able to do some scripting without learning TCL, trust me, this is a good thing.
To enable IOS.sh you just run "shell processing full" in configuration mode. Using "man" you can now see that you have both if, for, while and some other commands at your disposal.
Quick and dirty example;
**Router#for x in \interface Ethernet`; do echo $x `show int $x | inc input errors` ; done **
FastEthernet0/0 19inputerrors,0CRC,0frame,0overrun,19ignored
FastEthernet0/1 847inputerrors,0CRC,0frame,0overrun,847ignored
FastEthernet0/0/0 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/0/1 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/0/2 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/0/3 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/1/0 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/1/1 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/1/2 0inputerrors,0CRC,0frame,0overrun,0ignored
FastEthernet0/1/3 0inputerrors,0CRC,0frame,0overrun,0ignored
`
You can read more about it here I am sure Cisco will keep evolving IOS.sh and hopefully some really useful scripts will surface.

Daniel Husand

About

TG - Technical Blog is the unofficial rambling place of the Info:Systems, Tech:Net and Tech:Server crews from The Gathering.

Filter posts by crew

Related sites

Collaborators