<?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: Bash: Resolving Symlinks to Shellscripts</title>
	<atom:link href="http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Thu, 09 Feb 2012 02:58:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: sil</title>
		<link>http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/comment-page-1/#comment-64612</link>
		<dc:creator>sil</dc:creator>
		<pubDate>Sun, 12 Oct 2008 19:52:34 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=400#comment-64612</guid>
		<description>heh. I just came to say: what&#039;s wrong with readlink? Didn&#039;t know it wasn&#039;t on Macs. :)</description>
		<content:encoded><![CDATA[<p>heh. I just came to say: what&#8217;s wrong with readlink? Didn&#8217;t know it wasn&#8217;t on Macs. <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Colville</title>
		<link>http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/comment-page-1/#comment-64611</link>
		<dc:creator>Stuart Colville</dc:creator>
		<pubDate>Sat, 11 Oct 2008 10:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=400#comment-64611</guid>
		<description>@R Samuel Klatchko: 2 very good points well made!

ON linux I&#039;ve found that infact &lt;code&gt;readlink -f $0&lt;/code&gt; solves all the problems as it resolved relative paths and follows all the links correctly, the downside being mac&#039;s don&#039;t have gnu readlink by default! and the BSD equivalent has barely any functionality (That&#039;s Reason no.343249 to look at moving to Ubuntu for me!)

However currently I&#039;d ideally like a solution that works for Mac too. When I work out a portable solution I&#039;ll update the post.</description>
		<content:encoded><![CDATA[<p>@R Samuel Klatchko: 2 very good points well made!</p>
<p>ON linux I&#8217;ve found that infact <code>readlink -f $0</code> solves all the problems as it resolved relative paths and follows all the links correctly, the downside being mac&#8217;s don&#8217;t have gnu readlink by default! and the BSD equivalent has barely any functionality (That&#8217;s Reason no.343249 to look at moving to Ubuntu for me!)</p>
<p>However currently I&#8217;d ideally like a solution that works for Mac too. When I work out a portable solution I&#8217;ll update the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R Samuel Klatchko</title>
		<link>http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/comment-page-1/#comment-64610</link>
		<dc:creator>R Samuel Klatchko</dc:creator>
		<pubDate>Sat, 11 Oct 2008 06:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=400#comment-64610</guid>
		<description>Good first step, but I see at least two potential issues in it.

1) symlink chains (i.e. l2 symlinks to l1 symlinks to script).  If the script is invoked as l2, you&#039;ll get the directory of l1 instead of script.

2) relative symlinks.  If the symlink is relative rather then absolute, the directory name you get needs to be interpreted relative to the symlinks directory.</description>
		<content:encoded><![CDATA[<p>Good first step, but I see at least two potential issues in it.</p>
<p>1) symlink chains (i.e. l2 symlinks to l1 symlinks to script).  If the script is invoked as l2, you&#8217;ll get the directory of l1 instead of script.</p>
<p>2) relative symlinks.  If the symlink is relative rather then absolute, the directory name you get needs to be interpreted relative to the symlinks directory.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

