<?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>Random Wisdom &#187; console</title>
	<atom:link href="http://scrolls.mafgani.net/tag/console/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrolls.mafgani.net</link>
	<description>An attempt at organizing my thoughts ...</description>
	<lastBuildDate>Sun, 13 Mar 2011 22:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create links with absolute paths in Linux</title>
		<link>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/</link>
		<comments>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 19:10:18 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[file processing]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=420</guid>
		<description><![CDATA[The default behaviour of the linking command (ln) is a little strange under certain circumstances. Since it creates the links using the literal value of the target, symbolic links created using relative path structures can often fail. Consider the following: $ ln -s targetfile ../src/targetfile_link Without a doubt, &#8216;targetfile_link&#8217; will be a broken symlink since [...]]]></description>
			<content:encoded><![CDATA[<p>The default behaviour of the linking command (<strong>ln</strong>) is a little strange under certain circumstances. Since it creates the links using the literal value of the target, symbolic links created using relative path structures can often fail. Consider the following:</p>
<pre>$ ln -s targetfile ../src/targetfile_link</pre>
<p>Without a doubt, &#8216;targetfile_link&#8217; will be a broken symlink since it links to a target that it assumes is in the same directory:</p>
<pre>$ cd ../src &amp;&amp; ls -l targetfile_link
lrwxrwxrwx 1 mafgani mafgani 5 2010-01-16 18:19 targetfile_link -&gt; targetfile</pre>
<p>This is quite unfortunate since it clearly clashes with the way that the linking mechanism should work intuitively.</p>
<p>The solution is to force <strong>ln</strong> into automatically appending the absolute path to the target files. This can be achieved by using a simple shell script that acts as a wrapper for the real linking command:</p>
<pre style="color: #99ccff">
#!/bin/sh

# Step through the supplied arguments and append the absolute
# path to targets that exist
for ARG in $@
do
  if [ -e $ARG ]; then
    LNARGS="${LNARGS} ${PWD}/${ARG}";
  else
    LNARGS="${LNARGS} ${ARG}";
  fi
done

# Execute the actual link command with the modified args
exec /bin/ln ${LNARGS};
</pre>
<p>There are two known caveats:</p>
<ul>
<li> The link is &#8216;sub-optimal&#8217; if created from within the destination directory (the absolute path contains &#8216;../&#8217;s). It will still work however.</li>
<li>  The links will always be absolute. If that is undesirable, save the script as &#8216;absln&#8217; or something other than &#8216;ln&#8217;.</li>
</ul>
<p>Using &#8216;absln&#8217; instead of &#8216;ln&#8217; in the previously described scenario now produces a working symlink:</p>
<pre>$ absln -s targetfile ../src/targetfile_link
$ cd ../src/ &#038;&#038; ls -l targetfile_link
lrwxrwxrwx 1 mafgani mafgani 16 2010-01-16 19:13 targetfile_link -> /tmp/files/targetfile</pre>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Console based MSN client</title>
		<link>http://scrolls.mafgani.net/2005/11/console-based-msn-client/</link>
		<comments>http://scrolls.mafgani.net/2005/11/console-based-msn-client/#comments</comments>
		<pubDate>Fri, 04 Nov 2005 11:49:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[msn]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tmsnc]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=36</guid>
		<description><![CDATA[Earlier today I stumbled across a client for MSN Messenger that runs in a terminal! It&#8217;s called tmsnc. The RPM had some dependencies that I could not solve so I decided to compile from source. Apart from a few minor issues, it looks great! There are some screenshots available here. You might wonder why you [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today  I stumbled across a client for MSN Messenger that runs in a terminal! It&#8217;s called <span style="font-weight:bold;"><a href="http://tmsnc.sourceforge.net">tmsnc</a></span>.</p>
<p>The RPM had some dependencies that I could not solve so I decided to compile from source. Apart from a few minor issues, it looks great! There are some screenshots available <a href="http://tmsnc.sourceforge.net/screenshots.html">here</a>.</p>
<p>You might wonder why you need a text based MSN client; well, one can never have too many tools <img src='http://scrolls.mafgani.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2005/11/console-based-msn-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open files from a terminal</title>
		<link>http://scrolls.mafgani.net/2005/10/open-files-from-a-terminal/</link>
		<comments>http://scrolls.mafgani.net/2005/10/open-files-from-a-terminal/#comments</comments>
		<pubDate>Wed, 05 Oct 2005 22:48:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gnome-open]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=23</guid>
		<description><![CDATA[There&#8217;s lot that can be learned from the conversations on the fedora-list. Today I learnt of a nifty little tool called gnome-open. Basically you just type something like: [darkknight@darkworld ~]$ gnome-open file.cpp and voila! It figures out the default application (under GNOME) for the files of type *.cpp and opens the file using that default [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s lot that can be learned from the conversations on the <a href="https://www.redhat.com/archives/fedora-list/">fedora-list</a>. Today I learnt of a nifty little tool called <span style="font-weight:bold;">gnome-open</span>. Basically you just type something like:</p>
<pre>[darkknight@darkworld ~]$ gnome-open file.cpp</pre>
<p>and voila! It figures out the default application (under GNOME) for the files of type <span style="font-style:italic;">*.cpp</span> and opens the file using that default editor. I haven&#8217;t verified, but it seems that instead of a file an URL can also be specified. Mmm .. it definitely creates the possibility of writing portable scripts; at least on GNOME systems anyway <img src='http://scrolls.mafgani.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2005/10/open-files-from-a-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

