<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:go='http://ns.gigaom.com/'
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Dig Into Unix: Sed and Awk</title>
	<atom:link href="http://gigaom.com/apple/dig-into-unix-sed-and-awk/feed/" rel="self" type="application/rss+xml" />
	<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/</link>
	<description></description>
	<lastBuildDate>Sat, 11 Feb 2012 06:01:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tales of a Minnesota Geek &#187; Blog Archive &#187; links for 2009-08-12</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353419</link>
		<dc:creator><![CDATA[Tales of a Minnesota Geek &#187; Blog Archive &#187; links for 2009-08-12]]></dc:creator>
		<pubDate>Thu, 13 Aug 2009 04:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353419</guid>
		<description><![CDATA[[...] Dig Into Unix: Sed and Awk (tags: commandline bash unix tips terminal awk sed)        Post a Comment [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Dig Into Unix: Sed and Awk (tags: commandline bash unix tips terminal awk sed)        Post a Comment [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tal</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353418</link>
		<dc:creator><![CDATA[Tal]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 19:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353418</guid>
		<description><![CDATA[The problems with 

for each in ‘ls *.cfg‘;  

Are the following:

1) you are starting another process to handle this
2) you are neglecting files with spaces in the name(which makes it wrong). 


That&#039;s what makes the proposed loop wrong. The sed -i solution is the best, but the -i isn&#039;t posix.]]></description>
		<content:encoded><![CDATA[<p>The problems with </p>
<p>for each in ‘ls *.cfg‘;  </p>
<p>Are the following:</p>
<p>1) you are starting another process to handle this<br />
2) you are neglecting files with spaces in the name(which makes it wrong). </p>
<p>That&#8217;s what makes the proposed loop wrong. The sed -i solution is the best, but the -i isn&#8217;t posix.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Buys</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353417</link>
		<dc:creator><![CDATA[Jon Buys]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 15:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353417</guid>
		<description><![CDATA[That&#039;s one of the great things about the command line... there&#039;s more than one way to do it!]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s one of the great things about the command line&#8230; there&#8217;s more than one way to do it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Soli</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353416</link>
		<dc:creator><![CDATA[Soli]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 13:02:22 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353416</guid>
		<description><![CDATA[@Eric Crist: you&#039;re missing the point of Tal.

Both the original article and Tal&#039;s answer use &quot;for each in...&quot;, but the original article uses &quot;ls *.cfg&quot; whereas Tal only uses &quot;*.cfg&quot;

The &quot;ls&quot; part is the difference...

And note that if I remember correctly, &quot;for ... in&quot; will only work for the *sh family and not *csh shells, so I&#039;d say there is no &#039;correct&#039; way ;)]]></description>
		<content:encoded><![CDATA[<p>@Eric Crist: you&#8217;re missing the point of Tal.</p>
<p>Both the original article and Tal&#8217;s answer use &#8220;for each in&#8230;&#8221;, but the original article uses &#8220;ls *.cfg&#8221; whereas Tal only uses &#8220;*.cfg&#8221;</p>
<p>The &#8220;ls&#8221; part is the difference&#8230;</p>
<p>And note that if I remember correctly, &#8220;for &#8230; in&#8221; will only work for the *sh family and not *csh shells, so I&#8217;d say there is no &#8216;correct&#8217; way ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Crist</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353415</link>
		<dc:creator><![CDATA[Eric Crist]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 12:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353415</guid>
		<description><![CDATA[You are probably using bash, which is not guaranteed on all systems, or at least guaranteed to be the user&#039;s shell.  The &#039;correct&#039; way is to use the for each syntax, and not each, as Jon did, above.

For example:

ecrist@leopard:~-&gt; each in *.txt ; do cat $each
each: Command not found.
each: Undefined variable.]]></description>
		<content:encoded><![CDATA[<p>You are probably using bash, which is not guaranteed on all systems, or at least guaranteed to be the user&#8217;s shell.  The &#8216;correct&#8217; way is to use the for each syntax, and not each, as Jon did, above.</p>
<p>For example:</p>
<p>ecrist@leopard:~-&gt; each in *.txt ; do cat $each<br />
each: Command not found.<br />
each: Undefined variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Linkdump for August 12th at found_drama</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353414</link>
		<dc:creator><![CDATA[Linkdump for August 12th at found_drama]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 12:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353414</guid>
		<description><![CDATA[[...] Dig Into Unix: Sed and Awk  (tagged: sed awk tutorial todo ) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Dig Into Unix: Sed and Awk  (tagged: sed awk tutorial todo ) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Soli</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353413</link>
		<dc:creator><![CDATA[Soli]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 08:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353413</guid>
		<description><![CDATA[Indeed, moreover it seems that the &#039;g&#039; flag is useless here (there is usually only one &quot;line beginning&quot; per line).

Thus the example becomes
sed -i .bak &#039;30,35s/^/#/&#039; *.cfg]]></description>
		<content:encoded><![CDATA[<p>Indeed, moreover it seems that the &#8216;g&#8217; flag is useless here (there is usually only one &#8220;line beginning&#8221; per line).</p>
<p>Thus the example becomes<br />
sed -i .bak &#8217;30,35s/^/#/&#8217; *.cfg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danaville &#187; Blog Archive &#187; unix</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353412</link>
		<dc:creator><![CDATA[Danaville &#187; Blog Archive &#187; unix]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 05:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353412</guid>
		<description><![CDATA[[...]  Dig Into unix: Sed and Awk  Time again to pop a shell and dig into the deep, geeky unix internals of OS X with Dig Into &#8230; [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  Dig Into unix: Sed and Awk  Time again to pop a shell and dig into the deep, geeky unix internals of OS X with Dig Into &#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tal</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353411</link>
		<dc:creator><![CDATA[Tal]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 03:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353411</guid>
		<description><![CDATA[You actually did for each in ls?  Seriously?

Why not just: for each in *.cfg; which also has the added benefit of being correct.]]></description>
		<content:encoded><![CDATA[<p>You actually did for each in ls?  Seriously?</p>
<p>Why not just: for each in *.cfg; which also has the added benefit of being correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hagen Kaye</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353410</link>
		<dc:creator><![CDATA[Hagen Kaye]]></dc:creator>
		<pubDate>Wed, 12 Aug 2009 02:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353410</guid>
		<description><![CDATA[Awk is great, I use it all the time.

Another great scripting language is Expect (which is a TCL extension).  

Between the two I&#039;ve done some neat automated scripts.]]></description>
		<content:encoded><![CDATA[<p>Awk is great, I use it all the time.</p>
<p>Another great scripting language is Expect (which is a TCL extension).  </p>
<p>Between the two I&#8217;ve done some neat automated scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Westrup</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353409</link>
		<dc:creator><![CDATA[Erik Westrup]]></dc:creator>
		<pubDate>Tue, 11 Aug 2009 21:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353409</guid>
		<description><![CDATA[Oh great! Thanks for the article.]]></description>
		<content:encoded><![CDATA[<p>Oh great! Thanks for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Boulton</title>
		<link>http://gigaom.com/apple/dig-into-unix-sed-and-awk/#comment-353408</link>
		<dc:creator><![CDATA[Chris Boulton]]></dc:creator>
		<pubDate>Tue, 11 Aug 2009 21:35:30 +0000</pubDate>
		<guid isPermaLink="false">http://theappleblog.com/?p=29831#comment-353408</guid>
		<description><![CDATA[sed actually has an -i argument for editing in place (editing a file). The great thing about it, is that it can also automatically create backups for you by specifying the extension after the -i option.

So the first example can be something like:
&lt;code&gt;
sed -i .bak &#039;30,35s/^/#/g&#039; *.cfg
&lt;/code&gt;

Nifty, huh?]]></description>
		<content:encoded><![CDATA[<p>sed actually has an -i argument for editing in place (editing a file). The great thing about it, is that it can also automatically create backups for you by specifying the extension after the -i option.</p>
<p>So the first example can be something like:<br />
<code><br />
sed -i .bak '30,35s/^/#/g' *.cfg<br />
</code></p>
<p>Nifty, huh?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

