<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>unsigned long geek = random(); &#187; Scripting</title>
	<atom:link href="http://mjturner.net/blog/archives/category/development/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://mjturner.net/blog</link>
	<description>Michael-John Turner: Musings from a random UNIX geek</description>
	<lastBuildDate>Fri, 12 Jun 2009 22:28:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license>
		<item>
		<title>$ENV considered harmful</title>
		<link>http://mjturner.net/blog/archives/2005/02/13/env-considered-harmful/</link>
		<comments>http://mjturner.net/blog/archives/2005/02/13/env-considered-harmful/#comments</comments>
		<pubDate>Sun, 13 Feb 2005 15:20:21 +0000</pubDate>
		<dc:creator>Michael-John Turner</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">/?p=33</guid>
		<description><![CDATA[I have a moderately complicated set of rc files for the login shells I use (zsh where available, otherwise bash). To make things easier to manage, I have a single set of scripts that set the appropriate options for whichever shell is being used. To make things slightly more complicated, I export my home directory [...]]]></description>
			<content:encoded><![CDATA[<p>I have a moderately complicated set of rc files for the login shells I use (<a href="http://www.zsh.org">zsh</a> where available, otherwise <a href="http://www.gnu.org/software/bash/bash.html">bash</a>). To make things easier to manage, I have a single set of scripts that set the appropriate options for whichever shell is being used. To make things slightly more complicated, I export my home directory via NFS, so the same set of scripts are used on <a href="http://www.linux.org">Linux</a>, <a href="http://www.NetBSD.org">NetBSD</a> and <a href="http://www.sun.com/software/solaris/">Solaris</a> systems. Everything seemed to work well, or so I thought&#8230;</p>
<p>For a while I&#8217;ve been getting strange error messages when trying to view manual pages or when running certain shell scripts on my NetBSD machines. Errors like the following:</p>
<pre>
Syntax error: word unexpected (expecting ")")
</pre>
<p>I couldn&#8217;t find anything in Google, but thought it must have something to do with one of my environment variables interacting badly with man(1). After clearing pretty much all of them and hacking /etc/man.conf without luck, I realised it was NetBSD&#8217;s sh(1) that was causing the problem &#8211; with $ENV set, it was running my standard set of scripts and dying when encountering some zsh&#8217;isms (hint: &#8220;/bin/sh -v&#8221; is very useful).</p>
<p>Solution: clear $ENV and all is well. The problem was masked on Linux systems because almost all of them use bash as /bin/sh&#8230;</p>
<p>(Apologies to Tom Christiansen for the <a href="http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/">title</a> <img src='http://mjturner.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>
]]></content:encoded>
			<wfw:commentRss>http://mjturner.net/blog/archives/2005/02/13/env-considered-harmful/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>
