<?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: Best bash prompt. Ever.</title>
	<atom:link href="http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/</link>
	<description>Your blog is probably better than mine.</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:18:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Philippe</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-112938</link>
		<dc:creator>Philippe</dc:creator>
		<pubDate>Tue, 26 Oct 2010 11:03:31 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-112938</guid>
		<description>I think I finally figured it out :
http://www.box.net/shared/kxauj9ezym

Thank you very much for this smiley idea, I think it&#039;s a great ergonomic improvement.</description>
		<content:encoded><![CDATA[<p>I think I finally figured it out :<br />
<a href="http://www.box.net/shared/kxauj9ezym" rel="nofollow">http://www.box.net/shared/kxauj9ezym</a></p>
<p>Thank you very much for this smiley idea, I think it&#8217;s a great ergonomic improvement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philippe</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-111746</link>
		<dc:creator>Philippe</dc:creator>
		<pubDate>Wed, 13 Oct 2010 13:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-111746</guid>
		<description>I mean, this *should* work. But it does&#039;nt :(

PS1=&quot;$(if [ $? = 0 ] ; then echo &quot;:)&quot; ; else echo &quot;:(&quot;; fi) # &quot;</description>
		<content:encoded><![CDATA[<p>I mean, this *should* work. But it does&#8217;nt :(</p>
<p>PS1=&#8221;$(if [ $? = 0 ] ; then echo &#8220;:)&#8221; ; else echo &#8220;:(&#8220;; fi) # &#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philippe</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-111744</link>
		<dc:creator>Philippe</dc:creator>
		<pubDate>Wed, 13 Oct 2010 13:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-111744</guid>
		<description>This is both awesome and horrible

It&#039;s handsome because I too like to have a visual clue to point my old a deficient brain to a compile error

It&#039;s horrible because it combines the export and the test, rendering the code so obfuscated that any editor syntax parser will choke on it (let alone a human) and colorize it wrongly.

I&#039;d really like to find a workaround ; The catch is that the test must be done late, otherwise you might get return codes of another command, if not the test itself.
I tried putting the test in a function, and then calling COMMAND_PROMPT=myfunction but I could not get it to work. Any help ?

anyway, i like it. Thanks Dave.</description>
		<content:encoded><![CDATA[<p>This is both awesome and horrible</p>
<p>It&#8217;s handsome because I too like to have a visual clue to point my old a deficient brain to a compile error</p>
<p>It&#8217;s horrible because it combines the export and the test, rendering the code so obfuscated that any editor syntax parser will choke on it (let alone a human) and colorize it wrongly.</p>
<p>I&#8217;d really like to find a workaround ; The catch is that the test must be done late, otherwise you might get return codes of another command, if not the test itself.<br />
I tried putting the test in a function, and then calling COMMAND_PROMPT=myfunction but I could not get it to work. Any help ?</p>
<p>anyway, i like it. Thanks Dave.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheBonsai</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-100428</link>
		<dc:creator>TheBonsai</dc:creator>
		<pubDate>Fri, 26 Mar 2010 06:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-100428</guid>
		<description>@willdye

For the specific ANSI codes, there is no real technical reason. tput setaf/setab produce ANSI codes per definition (setaf - &quot;set ANSI foreground&quot;).

It gets interesting for all other codes that are not ANSI specific or defined in ANSI but may be implemented differently in your terminal (maybe a better version of it, or similar). What tput improves is the code readability, even for ANSI color codes. Direct ESC sequences look crazy in the code, compared to a $(tput ....).</description>
		<content:encoded><![CDATA[<p>@willdye</p>
<p>For the specific ANSI codes, there is no real technical reason. tput setaf/setab produce ANSI codes per definition (setaf &#8211; &#8220;set ANSI foreground&#8221;).</p>
<p>It gets interesting for all other codes that are not ANSI specific or defined in ANSI but may be implemented differently in your terminal (maybe a better version of it, or similar). What tput improves is the code readability, even for ANSI color codes. Direct ESC sequences look crazy in the code, compared to a $(tput &#8230;.).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Dye ("willdye")</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-98737</link>
		<dc:creator>William Dye ("willdye")</dc:creator>
		<pubDate>Fri, 19 Feb 2010 18:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-98737</guid>
		<description>For what it&#039;s worth, I tend to avoid using the ASCII escape codes directly, preferring code such as &quot;blue=$(tput setaf 4 2) instead.  According to http://mywiki.wooledge.org/BashFAQ/037 and http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes the tput method is preferred, though I can&#039;t think of an instance in which either method caused a serious problem for me.</description>
		<content:encoded><![CDATA[<p>For what it&#8217;s worth, I tend to avoid using the ASCII escape codes directly, preferring code such as &#8220;blue=$(tput setaf 4 2) instead.  According to <a href="http://mywiki.wooledge.org/BashFAQ/037" rel="nofollow">http://mywiki.wooledge.org/BashFAQ/037</a> and <a href="http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes" rel="nofollow">http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes</a> the tput method is preferred, though I can&#8217;t think of an instance in which either method caused a serious problem for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ice</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-98483</link>
		<dc:creator>Ice</dc:creator>
		<pubDate>Sat, 13 Feb 2010 17:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-98483</guid>
		<description>Great tip, thanks. I love your blog!

I&#039;m using it with some modifications (root in red, full path, shows svn revision):
&lt;pre&gt;
export PS1=&#039;`if [ \\$? = 0 ];
    then
        echo -e &quot;33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m &#124;&#124; echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 &#124; grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n &quot;33[1;34m&quot; ; echo -n $(svn info &#124; grep Revision:) ; echo -n &quot;33[0m&quot;))]33[32m\$33[0m &quot;;
    else
        echo -e &quot;33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m &#124;&#124; echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 &#124; grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n &quot;33[1;34m&quot; ; echo -n $(svn info &#124; grep Revision:) ; echo -n &quot;33[0m&quot;))]33[31m\$33[0m &quot;;
    fi; `&#039;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Great tip, thanks. I love your blog!</p>
<p>I&#8217;m using it with some modifications (root in red, full path, shows svn revision):</p>
<pre>
export PS1='`if [ \\$? = 0 ];
    then
        echo -e "33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m || echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 | grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n "33[1;34m" ; echo -n $(svn info | grep Revision:) ; echo -n "33[0m"))]33[32m\$33[0m ";
    else
        echo -e "33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m || echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 | grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n "33[1;34m" ; echo -n $(svn info | grep Revision:) ; echo -n "33[0m"))]33[31m\$33[0m ";
    fi; `'
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-89447</link>
		<dc:creator>Tobias</dc:creator>
		<pubDate>Mon, 12 Oct 2009 22:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-89447</guid>
		<description>Saw it, used it (with modifications), love it. Bonta-kun&#039;s suggestion is great.</description>
		<content:encoded><![CDATA[<p>Saw it, used it (with modifications), love it. Bonta-kun&#8217;s suggestion is great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kathryn</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-84162</link>
		<dc:creator>Kathryn</dc:creator>
		<pubDate>Mon, 03 Aug 2009 18:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-84162</guid>
		<description>This is great, totally using it. :)</description>
		<content:encoded><![CDATA[<p>This is great, totally using it. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bonta-Kun</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-76813</link>
		<dc:creator>Bonta-Kun</dc:creator>
		<pubDate>Sat, 25 Apr 2009 21:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-76813</guid>
		<description>It&#039;s not so bad, especially the coloring by exit-code. 

However, you might want to do something like: user@host:cwd (that is, put the current directory next to the host). Then you can use the whole string as an ssh/scp target/source...

Also, coloring the username differently depending on being root or not can really save you :)</description>
		<content:encoded><![CDATA[<p>It&#8217;s not so bad, especially the coloring by exit-code. </p>
<p>However, you might want to do something like: user@host:cwd (that is, put the current directory next to the host). Then you can use the whole string as an ssh/scp target/source&#8230;</p>
<p>Also, coloring the username differently depending on being root or not can really save you :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Smith</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-71382</link>
		<dc:creator>Jamie Smith</dc:creator>
		<pubDate>Fri, 30 Jan 2009 15:18:28 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-71382</guid>
		<description>I would like to prompt your bash.</description>
		<content:encoded><![CDATA[<p>I would like to prompt your bash.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

