<?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>hubflanger &#187; Bash</title>
	<atom:link href="http://hubflanger.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://hubflanger.com</link>
	<description>adventures in code</description>
	<lastBuildDate>Mon, 29 Mar 2010 22:41:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel='hub' href='http://hubflanger.com/?pushpress=hub'/>
		<item>
		<title>Leopard and Bash Shell environment paths</title>
		<link>http://hubflanger.com/leopard-and-bash-shell-environment-paths/</link>
		<comments>http://hubflanger.com/leopard-and-bash-shell-environment-paths/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 21:46:20 +0000</pubDate>
		<dc:creator>Peng</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Leopard]]></category>

		<guid isPermaLink="false">http://hubflanger.com/leopard-and-bash-shell-environment-paths/</guid>
		<description><![CDATA[If you recently made the upgrade to Leopard and you&#8217;re a frequent user of the OSX Terminal application, you may find that the environment paths that you had set up for the bash shell no longer work. Previously in Tiger, one can easily define those paths by creating a .bash_profile or .profile configuration file in [...]]]></description>
			<content:encoded><![CDATA[<p>If you recently made the upgrade to Leopard and you&#8217;re a frequent user of the OSX Terminal application, you may find that the environment paths that you had set up for the bash shell no longer work. Previously in Tiger, one can easily define those paths by creating a <code>.bash_profile</code> or <code>.profile</code> configuration file in the user directory, or editing the system-wide configuration file <code>/etc/.profile</code> directly if you have root access.</p>
<p>While I personally have never been able to make the configuration files work in the user directory, I&#8217;ve had success setting my environment paths in <code>/etc/.profile</code>. However, along with many other components that got shuffled around in the latest release of OSX, those profile settings are no longer found in the same locations. Oh why o why, Apple?</p>
<p><span id="more-34"></span><br />
In Leopard, the road to setting environment paths is a rather convoluted one. I wish Apple had made it easier but to date, I haven&#8217;t come across any other simpler solution. Here are the few steps that I took to resolve the issue: </p>
<ol>
<li>If you open <code>/etc/.profile</code> in a text editor, you&#8217;d see that the Terminal now loads the environment paths via a configuration file in <code>/usr/libexec/path_helper</code>.</li>
<li>Opening the <code>path_helper</code> file reveals that environment paths are now collectively stored in a file aptly named <code>paths</code> in the <code>etc</code> directory. Open <code>/etc/paths</code> and you&#8217;d see that all the environment paths are neatly listed here. You can simply add your desired paths such as <code>/usr/local/mysql/bin</code> to this list.</li>
<li>Relaunch the Terminal and test.</li>
</ol>
<p>Please note that root user needs to be enabled in order for you to edit the <code>/etc/paths</code> file. To enable the root user, see this <a href="http://www.macosxhints.com/article.php?story=20071025100950309" target="_blank">article</a>.</p>
<h3>Addendum</h3>
<p>Good news! Since writing this tutorial I had successfully implemented a <code>.bash_profile</code> file to my shell, effectively rendering the above procedure unnecessary. The secret is in applying the Unix <code>source</code> command which is built into the shell. Create your <code>.bash_profile</code> document at the root of your home directory as follows:</p>
<div class="codeblock">
export PATH=&#8221;/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mtasc:/usr/local/tomcat/bin:$PATH&#8221;
</div>
<p>and add any relevant paths that you may need. Then execute <code>source .bash_profile</code> in the command line. This ensures that changes to the environment made in <code>.bash_profile</code> are registered before you restart the shell. </p>
]]></content:encoded>
			<wfw:commentRss>http://hubflanger.com/leopard-and-bash-shell-environment-paths/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
