<?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>cat brain.log &#124; less &#187; bash</title>
	<atom:link href="http://log.largevoid.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.largevoid.com</link>
	<description>Getting it down on `paper`</description>
	<lastBuildDate>Wed, 01 Feb 2012 01:41:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get the Directory Path of a Bash Script</title>
		<link>http://log.largevoid.com/2010/06/directory-path-of-bash-scrip/</link>
		<comments>http://log.largevoid.com/2010/06/directory-path-of-bash-scrip/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 23:42:27 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[$0]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cwd]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[dirname]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[pwd]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=375</guid>
		<description><![CDATA[So you have a bash script and you want to run it from crontab or some other context where the current working directory isn&#8217;t known. Your script wants to use relative path information (from the script itself), perhaps to create a directory structure in the script&#8217;s base directory. The question is: How do you get [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a bash script and you want to run it from crontab or some other context where the current working directory isn&#8217;t known.  Your script wants to use relative path information (from the script itself), perhaps to create a directory structure in the script&#8217;s base directory.</p>
<p>The question is: How do you get the directory path of the script?  dirname?  Not reliably.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">ABSPATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(cd &quot;${0%/*}&quot; 2&gt;/dev/null; echo &quot;$PWD&quot;/&quot;${0##*/}&quot;)</span>&quot;</span>
<span style="color: #007800;">CWD</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ABSPATH</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>Nice!</p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/06/directory-path-of-bash-scrip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Less-Common Tools for Linux</title>
		<link>http://log.largevoid.com/2010/04/less-common-tools-for-linux/</link>
		<comments>http://log.largevoid.com/2010/04/less-common-tools-for-linux/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 00:41:07 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[kdialog]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[notify-send]]></category>
		<category><![CDATA[setleds]]></category>
		<category><![CDATA[setterm]]></category>
		<category><![CDATA[smbclient]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[tput]]></category>
		<category><![CDATA[zenity]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=331</guid>
		<description><![CDATA[As found here: 10 Tools to Add Some Spice to Your UNIX Shell Scripts. This is no substitute for the great write-up and screenshots that the author put together. It&#8217;s a summary for myself. The highlights (and how I really feel about them): notify-send (I never knew &#8212; better than tweat deck) tput (eh, maybe) [...]]]></description>
			<content:encoded><![CDATA[<p>As found here: <a href="http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html">10 Tools to Add Some Spice to Your UNIX Shell Scripts</a>.  This is no substitute for the great write-up and screenshots that the author put together.  It&#8217;s a summary for myself.</p>
<p>The highlights (and how I really feel about them):</p>
<ul>
<li>notify-send (I never knew &#8212; better than tweat deck)</li>
<li>tput (eh, maybe)</li>
<li>setleds (i don&#8217;t have lock-key LEDs on my keyboard)</li>
<li>zenity (has potential)</li>
<li>kdialog (better than zenity?  looks like VB functionality &#8212; good?)</li>
<li>dialog (like kdialog, but uses (n)curses, not kde)</li>
<li>logger (good to know!)</li>
<li>setterm (practical jokes&#8230; and maybe useful for modal/portal stuff)</li>
<li>smbclient (does that still work?  Couldn&#8217;t get past authentication prompt)</li>
<li>bash sockets (interesting&#8230; ICP?  wasteful)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/04/less-common-tools-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>STDERR redirect into STDOUT redirect into file</title>
		<link>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/</link>
		<comments>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 02:00:08 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=12</guid>
		<description><![CDATA[When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file. The right way: Redirect stderr and stdout to [[file]]: [[command]] &#62; [[file]] 2&#62;&#38;1 Redirect stderr to [[efile]] and stdout to [[file]]: [[command]] 2&#62; [[efile]] &#62; [[file]] [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file.</p>
<p><strong>The right way:</strong></p>
<p>Redirect stderr and stdout to [[file]]:</p>
<p><code>[[command]] &gt; [[file]] 2&gt;&amp;1</code></p>
<p>Redirect stderr to [[efile]] and stdout to [[file]]:</p>
<p><code>[[command]] 2&gt; [[efile]] &gt; [[file]]</code></p>
<p><strong>The wrong way:</strong></p>
<p>Doesn’t do anything useful:</p>
<p><code>[[command]] 2&gt;&amp;1 &gt; [[file]]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2009/10/stderr-redirect-into-stdout-redirect-into-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  log.largevoid.com/tag/bash/feed/ ) in 0.23166 seconds, on Feb 5th, 2012 at 5:05 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 6:05 pm UTC -->
