<?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>Spice World! &#187; sh</title>
	<atom:link href="http://www.cyberspice.org.uk/blog/tag/sh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberspice.org.uk/blog</link>
	<description>The life and times of a jet setting software engineer!</description>
	<lastBuildDate>Fri, 02 Dec 2011 14:52:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>T&#8217;info about Dash</title>
		<link>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:45:15 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[libncurses]]></category>
		<category><![CDATA[libtinfo]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=404</guid>
		<description><![CDATA[Once upon a time there was the Bourne command shell. sh as it is known is core at the heart of any UNIXy type operating system and others too. However for some it didn&#8217;t do enough so the Bourne Again shell, bash, was written and nearly every system ships with that. These shells are not [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time there was the Bourne command shell.  <strong>sh</strong> as it is known is core at the heart of any UNIXy type operating system and others too.  However for some it didn&#8217;t do enough so the Bourne Again shell, <strong>bash</strong>, was written and nearly every system ships with that.  These shells are not the same.  The have similar syntax but do not behave similarly.</p>
<p>There are other shells which have a completely different syntax and other scripting languages such as Perl and PHP so when writing a shell script you can indicate the correct interpreter using the <em>&#8216;hash bang bin bash&#8217;</em> comment to indicate you are using <strong>bash</strong>.  I.e.</p>
<pre>
#!/bin/bash
</pre>
<p>Some lazy programmers don&#8217;t indicate the exact shell they require and use </p>
<pre>
#!/bin/sh
</pre>
<p>to mean <strong>bash</strong> when it means <strong>sh</strong>.</p>
<p>Ubuntu, in their wisdom, have decided to go for <strong>dash</strong> as their shell.  It is an evolution of the Almquist shell and is smaller and lighter weight than <strong>bash</strong> however they install <strong>bash</strong> anyway.  <strong>dash</strong> and <strong>bash</strong> have the common subset of <strong>sh</strong> commands but are different.  So if you find you have a problem building or similar on Ubuntu it may be that the wrong shell is being used.  Ubuntu has a symlink as follows:</p>
<pre>
lrwxrwxrwx 1 root root       4 Mar 29  2009 sh -> dash
</pre>
<p>You may need to change this to point to dash as follows:</p>
<pre>
$ cd /bin
$ sudo rm sh
$ sudo ln -s bash sh
</pre>
<p>While we&#8217;re handling Ubuntu oddities building against NCurses, the terminal output library, can also be problematical.  A little while ago NCurses was split in to two libraries, <em>libncurses.so</em> and <em>libtinfo.so</em>.  Some badly written software will try and link explicitly with <em>libtinfo.so</em> directly rather than trying <em>libncurses.so</em> first.  Ubuntu does not split these two libraries but provides just the one <em>libncurses.so</em> library so if you have an issue with a missing <em>libtinfo.so</em> you will need to add symlinks in to your library directory as follows:</p>
<pre>
$ cd /usr/lib
$ ln -s libncurses.so.5 libtinfo.so.5
$ ln -s libtinfo.so.5 libtinfo.so
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

