<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HandsomePlanet &#187; command</title>
	<atom:link href="http://www.handsomeplanet.com/archives/tag/command/feed" rel="self" type="application/rss+xml" />
	<link>http://www.handsomeplanet.com</link>
	<description>technology and other perplexities</description>
	<lastBuildDate>Sun, 05 Sep 2010 02:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>upgrading an Ubuntu server from the command line</title>
		<link>http://www.handsomeplanet.com/archives/12</link>
		<comments>http://www.handsomeplanet.com/archives/12#comments</comments>
		<pubDate>Fri, 08 May 2009 17:43:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=12</guid>
		<description><![CDATA[This is how I upgraded from 8.10 to 9.04 over the network: sudo apt-get install update-manager-core sudo do-release-upgrade [reference : http://www.ubuntu.com/getubuntu/upgrading ]]]></description>
			<content:encoded><![CDATA[<p>This is how I upgraded from 8.10 to 9.04 over the network:</p>
<p>sudo apt-get install update-manager-core<br />
sudo do-release-upgrade</p>
<p>[reference : http://www.ubuntu.com/getubuntu/upgrading ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS CLI regular expressions (&#8220;Ceci n&#8217;est pas une pipe.&#8221;)</title>
		<link>http://www.handsomeplanet.com/archives/7</link>
		<comments>http://www.handsomeplanet.com/archives/7#comments</comments>
		<pubDate>Tue, 31 Mar 2009 15:09:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=7</guid>
		<description><![CDATA[[taken from a  note originally written March 2007] Yesterday, I was trying to find a method to implement an  ‘AND’ function within the Cisco IOS cisco command line.  I was familiar with the  ‘OR’ function available through the ‘&#124;’ symbol (which is to say, the same symbol as the pipe). For example, if you wanted [...]]]></description>
			<content:encoded><![CDATA[<address>[taken from a  note originally written March 2007]<br />
</address>
<p>Yesterday, I was trying to find a method to implement an  ‘AND’ function within the Cisco IOS cisco command line.  I was familiar with the  ‘OR’ function available through the ‘|’ symbol (which is to say, the same symbol as the pipe).</p>
<p>For example, if you wanted to show the running config, and filter out lines that contained either ‘foo’ or ‘bar’, you could type</p>
<p><code>show run | include foo|bar</code></p>
<p>The second &#8220;pipe,&#8221;  in this case, isn’t a pipe, but the symbol for an ‘OR’ function.  (&#8220;Ceci n&#8217;est pas une pipe.&#8221;)</p>
<p><a href="http://en.wikipedia.org/wiki/The_Treachery_of_Images"><img class="size-full wp-image-35 alignright" title="300px-magrittepipe" src="http://www.handsomeplanet.com/wp-content/uploads/2009/03/300px-magrittepipe.jpg" alt="Magritte -- this (pipe) is not a pipe" width="300" height="230" /></a></p>
<p>I wasn’t able to find a way to do an ‘AND’ in an analogous fashion, but I  did find a decent Cisco webpage on CLI and regular expressions (regexp) that helped a bit. That page can be found here: <a title="http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm" onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm" target="_blank">http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm </a></p>
<p>It is possible to do ‘AND’ type functions implicitly by using a more complex set of matching rules based on regular expressions.</p>
<p>Here’s a example that shows (from an interactive session on the Cisco CLI) if access-lists have been applied to interfaces using the &#8220;access-group&#8221; command:</p>
<p><code>sh run | include (^interface [A-Z])|(ip access-group [0-9a-zA-Z])</code></p>
<p>Lines that start with ‘interface’ followed by an uppercase letter (the expression matches anything in the range A-Z) are supposed to match things like ‘interface Fastethernet,’ ‘interface Serial’ and so on. The second part of the expression matches access-groups that have three possible initial character ranges: a lowercase letter (a-z), an uppercase letter (A-Z), or a number (0-9) for the standard access lists.<br />
Some rudimentary filtering is done, so things like Loopback sourcing, route-maps, and so on, don’t match.</p>
<p>Interfaces that have no access-lists applied have on the interface name listed, but interfaces with an access-group command show the complete access-group statement under the relevant interface (which makes sense, given that this is only a filtered ’show run’).</p>
<p>Output might look something like this:</p>
<p><code>interface Serial3/3<br />
interface Serial3/3.1 point-to-point<br />
ip access-group pac in<br />
ip access-group ket out<br />
interface FastEthernet4/0<br />
interface Serial6/0<br />
ip access-group Ozona in</code></p>
<p>If this kind of function is useful for you, it is even easier to use if you put it in an alias on your switch or router:</p>
<p><code>#conf t<br />
#alias exec shag sh run | include (^interface [A-Z])|(ip access-group [0-9a-zA-Z])</code></p>
<p>You should, of course, pick a name for the alias that you’ll remember.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
