<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Showing last two directories of pwd in BASH prompt</title>
	<atom:link href="http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Wed, 10 Mar 2010 11:00:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pwdn: show last n dirs of current directory by Stuart Colville</title>
		<link>http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/comment-page-1/#comment-64191</link>
		<dc:creator>pwdn: show last n dirs of current directory by Stuart Colville</dc:creator>
		<pubDate>Wed, 02 Apr 2008 15:03:59 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/#comment-64191</guid>
		<description>[...] and alias to servers and in doing so I was looking back at the code I am calling to display the last two directories in my bash prompt. It made me think; why don&#8217;t I write a command in C to do that for me? Partly for the lulz [...]</description>
		<content:encoded><![CDATA[<p>[...] and alias to servers and in doing so I was looking back at the code I am calling to display the last two directories in my bash prompt. It made me think; why don&#8217;t I write a command in C to do that for me? Partly for the lulz [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angus Turnbull</title>
		<link>http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/comment-page-1/#comment-63630</link>
		<dc:creator>Angus Turnbull</dc:creator>
		<pubDate>Mon, 22 Oct 2007 05:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/#comment-63630</guid>
		<description>Cool trick!

As a challenge to myself, I decided to rewrite this PWD function using only Bash built-ins after learning of parameter substitution. It actually does work! Here&#039;s the resulting code, if you&#039;re interested:

&lt;code&gt;
function PWD {
 tmp=${PWD%/*/*};
 [ ${#tmp} -gt 0 -a &quot;$tmp&quot; != &quot;$PWD&quot; ] &amp;&amp; echo ${PWD:${#tmp}+1} &#124;&#124; echo $PWD;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Cool trick!</p>
<p>As a challenge to myself, I decided to rewrite this PWD function using only Bash built-ins after learning of parameter substitution. It actually does work! Here&#8217;s the resulting code, if you&#8217;re interested:</p>
<p><code><br />
function PWD {<br />
 tmp=${PWD%/*/*};<br />
 [ ${#tmp} -gt 0 -a "$tmp" != "$PWD" ] &amp;&amp; echo ${PWD:${#tmp}+1} || echo $PWD;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michaël Guitton</title>
		<link>http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/comment-page-1/#comment-63237</link>
		<dc:creator>Michaël Guitton</dc:creator>
		<pubDate>Tue, 09 Oct 2007 09:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/#comment-63237</guid>
		<description>You can achieve this in C Shell (csh, tcsh) by adding the following statement to your .cshrc file:

&lt;code&gt;set prompt = &quot;%c2 # &quot;&lt;/code&gt;

or 

&lt;code&gt;set ellipsis = 1
set prompt = &quot;%c02 # &quot;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>You can achieve this in C Shell (csh, tcsh) by adding the following statement to your .cshrc file:</p>
<p><code>set prompt = "%c2 # "</code></p>
<p>or </p>
<p><code>set ellipsis = 1<br />
set prompt = "%c02 # "</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Katalog Stron</title>
		<link>http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/comment-page-1/#comment-61456</link>
		<dc:creator>Katalog Stron</dc:creator>
		<pubDate>Wed, 26 Sep 2007 23:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2007/09/25/showing-last-two-directories-of-pwd-in-bash-prompt/#comment-61456</guid>
		<description>Great function in code, thanks from Poland :)</description>
		<content:encoded><![CDATA[<p>Great function in code, thanks from Poland <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
