<?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/"
		>
<channel>
	<title>Comments on: Escaping a pipe inside xargs</title>
	<atom:link href="http://www.andyd.net/2009/escaping-a-pipe-inside-xargs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andyd.net/2009/escaping-a-pipe-inside-xargs/</link>
	<description>Andy Davidson's tech blog</description>
	<lastBuildDate>Tue, 22 Jun 2010 10:49:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andy</title>
		<link>http://www.andyd.net/2009/escaping-a-pipe-inside-xargs/comment-page-1/#comment-70</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Mon, 23 Mar 2009 12:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.andyd.net/?p=142#comment-70</guid>
		<description>Lots of people on twitter have pointed out that for loops would have led to the most readable format for this code - good suggestion !</description>
		<content:encoded><![CDATA[<p>Lots of people on twitter have pointed out that for loops would have led to the most readable format for this code &#8211; good suggestion !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: craiga</title>
		<link>http://www.andyd.net/2009/escaping-a-pipe-inside-xargs/comment-page-1/#comment-69</link>
		<dc:creator>craiga</dc:creator>
		<pubDate>Mon, 23 Mar 2009 11:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.andyd.net/?p=142#comment-69</guid>
		<description>That way is fine. The &#124; is a function of the shell, but xargs just execs the command you pass to it so escaping the pipes just makes the process think you&#039;re passing a &#124; character on the command line. You can wrap the whole command line inside a shell by passing &#039;sh -c&#039; to xargs instead of echo, like this:

crazy &#124; stuff &#124; xargs -i {} sh -c &quot;this {} &#124; that {}&quot;

That doesn&#039;t really add anything to your current method, though, and you do get the benefit of being able to pipe to a file for sanity checks if you use echo.</description>
		<content:encoded><![CDATA[<p>That way is fine. The | is a function of the shell, but xargs just execs the command you pass to it so escaping the pipes just makes the process think you&#8217;re passing a | character on the command line. You can wrap the whole command line inside a shell by passing &#8217;sh -c&#8217; to xargs instead of echo, like this:</p>
<p>crazy | stuff | xargs -i {} sh -c &#8220;this {} | that {}&#8221;</p>
<p>That doesn&#8217;t really add anything to your current method, though, and you do get the benefit of being able to pipe to a file for sanity checks if you use echo.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
