<?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>Unreal Expectations &#187; one line commands</title>
	<atom:link href="http://unrealexpectations.com/blog/category/one-line-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://unrealexpectations.com/blog</link>
	<description>That actually worked??!??</description>
	<lastBuildDate>Wed, 23 Jun 2010 04:32:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>One Line Command &#8211; Print Directory Tree</title>
		<link>http://unrealexpectations.com/blog/2010/01/one-line-command-print-directory-tree/</link>
		<comments>http://unrealexpectations.com/blog/2010/01/one-line-command-print-directory-tree/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:56:45 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[one line commands]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=68</guid>
		<description><![CDATA[<p>While this blog is new, I want to ensure I keep content going lest it goes abandoned and six months from now I wonder what happened.  Most of my original inspiration on putting content here is based on useful work I do.  Not having anything interesting to share from current work, I&#8217;ll share [...]]]></description>
			<content:encoded><![CDATA[<p>While this blog is new, I want to ensure I keep content going lest it goes abandoned and six months from now I wonder what happened.  Most of my original inspiration on putting content here is based on useful work I do.  Not having anything interesting to share from current work, I&#8217;ll share a segment of things I find interesting and useful from time to time.</p>
<p>So this post is kicking off my category of &#8220;One Line Commands&#8221;.  Over the years I have found myself finding, grepping, cutting and PERLing through directories and files to find some useful information to solve some issue.  This first example is a PERL script that recurses through directory tree printing and adds indent based on the current level.  Output can be sent to a file and imported into Excel.  It is setup to ignore subversion files/directories because at the time I wanted to get a full directory tree from a checked out repository.</p>
<p><pre><code>
perl -e &#039;use File::Find; sub pl {my ($sc) = @_; print &quot;\t&quot; while ($sc--
&gt; 0); } sub wanted { $f=$_; $fn=$File::Find::name; return if $fn =~ /.svn/; my
$sc=($fn =~tr/\///); if (-d $fn) {pl($sc); print &quot;$f/\n&quot;;} else {pl($sc); print
 &quot;$f&quot;; pl(20-$sc); print &quot;$fn\n&quot;;}};  find(\&amp;wanted, (&quot;.&quot;));&#039;
</code></pre></p>
<p>Copy and pastes into one command line entry. </p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/01/one-line-command-print-directory-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
