<?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>Pivotal Labs &#187; shell script</title>
	<atom:link href="http://pivotallabs.com/tag/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Tue, 21 May 2013 05:27:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Use fold to wrap long lines for an easier diff</title>
		<link>http://pivotallabs.com/use-fold-to-wrap-long-lines-for-an-easier-diff/</link>
		<comments>http://pivotallabs.com/use-fold-to-wrap-long-lines-for-an-easier-diff/#comments</comments>
		<pubDate>Fri, 01 Mar 2013 21:13:31 +0000</pubDate>
		<dc:creator>Mark Rushakoff</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[text-wrapping]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=15741</guid>
		<description><![CDATA[<p>We had two versions of a not-really-intended-to-be-human-readable file that were only slightly different, and we wanted to know how they were different. The lines were several hundred characters long, so when we diffed the files, we saw a basically useless output of @@ -1 +1 @@ - bf659d7a2e0e45223095367c561526f8a10311459433adf322f2590a4987c423e55afe6e88abb09f0bee39549f1dfbbdfba99e39c0b70a7a656d07061ee113676f0d6db25d88c8034db6d9d8beec42daaaf8818273d9436fca8f442cdb6245c285c33638 + bf659d7a2e0e45223095367c561526f8a10311459433adf322f2590a4987c423e55afe6e88abb09f0bee39549f1dfbbdfba99e39c0b70a7a656d07061ee113676f0d6db25d88c8034db6d9d8beec42daaaf8818278d9436fca8f442cdb6245c285c33638 My usual trick of opening the file in Vim and using gq didn&#8217;t work because there was no whitespace in the string, and Vim (at least in my configuration) will only split on whitespace. Text-wrapping is certainly not a new problem &#8212; surely there&#8217;s a Unix utility for that, I thought. And sure enough, fold was there to help. After folding at an arbitrary length of 25 characters (with fold -w 25 $FILE), the diff output became readable and thus useful: @@ -4,5 +4,5 @@ bb09f0bee39549f1dfbbdfba9 9e39c0b70a7a656d07061ee11 3676f0d6db25d88c8034db6d9 -d8beec42daaaf8818273d9436 +d8beec42daaaf8818278d9436 fca8f442cdb6245c285c33638 Now can you see the 3 that turned into&#8230;</p><p>The post <a href="http://pivotallabs.com/use-fold-to-wrap-long-lines-for-an-easier-diff/">Use fold to wrap long lines for an easier diff</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>We had two versions of a not-really-intended-to-be-human-readable file that were only slightly different, and we wanted to know <em>how</em> they were different. The lines were several hundred characters long, so when we <code>diff</code>ed the files, we saw a basically useless output of</p>
<pre><code>
@@ -1 +1 @@
- bf659d7a2e0e45223095367c561526f8a10311459433adf322f2590a4987c423e55afe6e88abb09f0bee39549f1dfbbdfba99e39c0b70a7a656d07061ee113676f0d6db25d88c8034db6d9d8beec42daaaf8818273d9436fca8f442cdb6245c285c33638
+ bf659d7a2e0e45223095367c561526f8a10311459433adf322f2590a4987c423e55afe6e88abb09f0bee39549f1dfbbdfba99e39c0b70a7a656d07061ee113676f0d6db25d88c8034db6d9d8beec42daaaf8818278d9436fca8f442cdb6245c285c33638
</code></pre>
<p>My usual trick of opening the file in Vim and using <a href="http://vimdoc.sourceforge.net/htmldoc/change.html#gq"><code>gq</code></a> didn&#8217;t work because there was no whitespace in the string, and Vim (at least in my configuration) will only split on whitespace.</p>
<p>Text-wrapping is certainly not a new problem &#8212; surely there&#8217;s a Unix utility for that, I thought.  And sure enough, <a href="http://www.esrl.noaa.gov/gmd/dv/hats/cats/stations/qnxman/fold.html"><code>fold</code></a> was there to help.</p>
<p>After folding at an arbitrary length of 25 characters (with <code>fold -w 25 $FILE</code>), the diff output became readable and thus useful:</p>
<pre><code>
@@ -4,5 +4,5 @@
 bb09f0bee39549f1dfbbdfba9
 9e39c0b70a7a656d07061ee11
 3676f0d6db25d88c8034db6d9
-d8beec42daaaf8818273d9436
+d8beec42daaaf8818278d9436
 fca8f442cdb6245c285c33638
</code></pre>
<p>Now can you see the 3 that turned into an 8?  </p>
<p><small>(Of course, this whole situation could have been avoided if we tried to make that output human-readable in the first place.  Live and learn!)</small></p>
<p>The post <a href="http://pivotallabs.com/use-fold-to-wrap-long-lines-for-an-easier-diff/">Use fold to wrap long lines for an easier diff</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/use-fold-to-wrap-long-lines-for-an-easier-diff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching 17/22 queries in 0.039 seconds using apc
Object Caching 398/440 objects using apc

 Served from: pivotallabs.com @ 2013-05-21 04:46:09 by W3 Total Cache -->