<?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: Hack 1. Use CDPATH to define the base directory for cd command</title>
	<atom:link href="http://linux.101hacks.com/cd-command/cdpath/feed/" rel="self" type="application/rss+xml" />
	<link>http://linux.101hacks.com/cd-command/cdpath/</link>
	<description>Free eBook to Build a Strong Foundation in UNIX / Linux</description>
	<lastBuildDate>Thu, 01 Dec 2011 10:33:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jonathan</title>
		<link>http://linux.101hacks.com/cd-command/cdpath/comment-page-1/#comment-2016</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Thu, 20 Jan 2011 02:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://linux.101hacks.com/?p=3#comment-2016</guid>
		<description>Exporting CDPATH has the unfortunate side effect of breaking some utilities implemented as shell scripts. (There are two effects shell script authors might not be prepared for: &quot;cd&quot; suddenly jumps to unexpected directories, and it writes text to the standard output.)

By contrast, a simple

if test &quot;${PS1+set}&quot;; then CDPATH=whatever; fi

in .bashrc sets CDPATH in interactive shells, without exporting it to noninteractive scripts.

From &lt;a href=&quot;https://git.wiki.kernel.org/index.php?title=GitFaq&amp;oldid=12932#Why_is_it_wrong_to_export_the_environment_variable_CDPATH.3F&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Exporting CDPATH has the unfortunate side effect of breaking some utilities implemented as shell scripts. (There are two effects shell script authors might not be prepared for: &#8220;cd&#8221; suddenly jumps to unexpected directories, and it writes text to the standard output.)</p>
<p>By contrast, a simple</p>
<p>if test &#8220;${PS1+set}&#8221;; then CDPATH=whatever; fi</p>
<p>in .bashrc sets CDPATH in interactive shells, without exporting it to noninteractive scripts.</p>
<p>From <a href="https://git.wiki.kernel.org/index.php?title=GitFaq&amp;oldid=12932#Why_is_it_wrong_to_export_the_environment_variable_CDPATH.3F" rel="nofollow">here</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francois Begin</title>
		<link>http://linux.101hacks.com/cd-command/cdpath/comment-page-1/#comment-375</link>
		<dc:creator>Francois Begin</dc:creator>
		<pubDate>Mon, 05 Apr 2010 20:00:42 +0000</pubDate>
		<guid isPermaLink="false">http://linux.101hacks.com/?p=3#comment-375</guid>
		<description>The order in which you define the directories with CDPATH determines where you end up. For instance, assume you have set CDPATH to this

   CDPATH=.:/var:~

If you are located at the root of the filesystem (/) and type in &#039;cd tmp&#039;, you will end up in /tmp since the &#039;cd&#039; command matches &#039;./tmp&#039; first. 

If you were in /etc when you type &#039;cd tmp&#039;, then &#039;cd&#039; would look for &#039;./tmp&#039; i.e. &#039;/etc/tmp&#039; first. If not found, it would then look for /var/tmp. If not found, it would finally look for ~/tmp. 

Just keep that in mind if you have multiple entries in CDPATH and try to go into a subdirectory with a common name such as &#039;log&#039;, &#039;tmp&#039;, etc.</description>
		<content:encoded><![CDATA[<p>The order in which you define the directories with CDPATH determines where you end up. For instance, assume you have set CDPATH to this</p>
<p>   CDPATH=.:/var:~</p>
<p>If you are located at the root of the filesystem (/) and type in &#8216;cd tmp&#8217;, you will end up in /tmp since the &#8216;cd&#8217; command matches &#8216;./tmp&#8217; first. </p>
<p>If you were in /etc when you type &#8216;cd tmp&#8217;, then &#8216;cd&#8217; would look for &#8216;./tmp&#8217; i.e. &#8216;/etc/tmp&#8217; first. If not found, it would then look for /var/tmp. If not found, it would finally look for ~/tmp. </p>
<p>Just keep that in mind if you have multiple entries in CDPATH and try to go into a subdirectory with a common name such as &#8216;log&#8217;, &#8216;tmp&#8217;, etc.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Content Delivery Network via Amazon Web Services: CloudFront: static.101hacks.com

Served from: linux.101hacks.com @ 2012-02-04 04:01:57 -->
