<?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>Eamonn's Ramblings &#187; Apple</title>
	<atom:link href="http://bogpeople.com/blog/?feed=rss2&#038;cat=11" rel="self" type="application/rss+xml" />
	<link>http://bogpeople.com/blog</link>
	<description>Sharing The Few Thoughts I Have With The World</description>
	<lastBuildDate>Tue, 06 Jan 2009 15:43:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finding IP addresses hidden in &#8220;ifconfig -a&#8221;</title>
		<link>http://bogpeople.com/blog/?p=17</link>
		<comments>http://bogpeople.com/blog/?p=17#comments</comments>
		<pubDate>Tue, 06 Jan 2009 15:31:27 +0000</pubDate>
		<dc:creator>eamonn</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bogpeople.com/blog/?p=17</guid>
		<description><![CDATA[Wow&#8230;is it really over a year since my last blog post ?
Anyway, here&#8217;s something which I hope will be useful.
I find it awkward to pick out my Mac&#8217;s IP addresses at a glance from the output of &#8220;ifconfig -a&#8221;.  Here&#8217;s a command-line that makes it very easy&#8230;
[eamonn@stig ~]$ ifconfig -a &#124; perl -ne '$interface=$1 if [...]]]></description>
			<content:encoded><![CDATA[<p>Wow&#8230;is it really over a year since my last blog post ?</p>
<p>Anyway, here&#8217;s something which I hope will be useful.</p>
<p>I find it awkward to pick out my Mac&#8217;s IP addresses at a glance from the output of &#8220;ifconfig -a&#8221;.  Here&#8217;s a command-line that makes it very easy&#8230;</p>
<p><code>[eamonn@stig ~]$ <b><span style="color: #0000ff;">ifconfig -a | perl -ne '$interface=$1 if (/^([a-z]+[0-9]+:)/); print "$interface $1\n" if (/inet (\d+\.\d+\.\d+\.\d+)/);'</span></b><br />
lo0: 127.0.0.1<br />
en0: 192.168.78.112</code></p>
<p>Now even the most commited command-line disciple is likely to baulk at typing all that, so I have an alias set up in ~/.bash_login.  The quotes are a little fiddly to get right, so here&#8217;s the alias&#8230;</p>
<p><code>alias ipa='ifconfig -a | perl -ne '\''$interface=$1 if (/^([a-z]+[0-9]+:)/); print "$interface $1\n" if (/inet (\d+\.\d+\.\d+\.\d+)/);'\'</code><br />
 <br />
A slight variation of the same thing works on Linux also (with adjustments to compensate for the differences  in output format)&#8230;<br />
 <br />
<code>alias ipa='ifconfig -a | perl -ne '\''$interface=$1 if (/^([a-z]+[0-9]+) /); print "$interface $1\n" if (/inet addr:(\d+\.\d+\.\d+\.\d+)/);'\'</code></p>
<p>I hope its useful&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bogpeople.com/blog/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
