<?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; path</title>
	<atom:link href="http://log.largevoid.com/tag/path/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.largevoid.com</link>
	<description>Getting it down on `paper`</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:23:55 +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>Recursive directory merge</title>
		<link>http://log.largevoid.com/2010/03/recursive-directory-merge/</link>
		<comments>http://log.largevoid.com/2010/03/recursive-directory-merge/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 01:08:00 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[filies]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[mv]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=309</guid>
		<description><![CDATA[Problem: I have two directories that are similar in structure but different in content. Say one is an older snapshot of the other. I want to copy the stuff from the new directory into the old directory (recursively). Copy: rsync -a SOURCE/ DEST/ --ignore-existing --whole-file Move (no clobber): rsync -a SOURCE/ DEST/ --remove-sent-files --ignore-existing --whole-file [...]]]></description>
			<content:encoded><![CDATA[<p>Problem: I have two directories that are similar in structure but different in content.  Say one is an older snapshot of the other.  I want to copy the stuff from the new directory into the old directory (recursively).</p>
<p>Copy:<br />
<code>rsync -a SOURCE/ DEST/ --ignore-existing --whole-file</code></p>
<p>Move (no clobber):<br />
<code>rsync -a SOURCE/ DEST/ --remove-sent-files --ignore-existing --whole-file</code></p>
<p>Move (and clobber):<br />
<code>rsync -a SOURCE/ DEST/ --remove-sent-files --whole-file</code></p>
<p>Move, but only update with newer:<br />
<code>rsync -a SOURCE/ DEST/ --remove-sent-files --update --whole-file</code></p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/03/recursive-directory-merge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  log.largevoid.com/tag/path/feed/ ) in 0.22451 seconds, on Feb 8th, 2012 at 3:55 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 8th, 2012 at 4:55 am UTC -->
