<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.5" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Aron Griffis - Latest comments on requoting in bash</title>
		<link>http://blogs.gentoo.org/agriffis?disp=comments</link>
		<description></description>
		<language>en-US</language>
		<docs>http://backend.userland.com/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.5"/>
		<ttl>60</ttl>
				<item>
			<title>In response to: requoting in bash</title>
			<pubDate>Thu, 09 Feb 2006 00:57:53 +0000</pubDate>
			<dc:creator>TGL [Visitor]</dc:creator>
			<guid isPermaLink="false">c2872@http://blogs.gentoo.org/</guid>
			<description>Yup, you're absolutly right that my solution relies on backslashes being used for quoting. If that changes, it would break, and thus I fully agree your conclusion about it not being an option.&lt;br /&gt;
&lt;br /&gt;
Actually, I wrote this 4 lines mainly because i've found this problem funny, but the implementation i really prefer is your original one with no printf (it's the easiest to read/understand imho, and sure it's also, by far, the fastest one).</description>
			<content:encoded><![CDATA[Yup, you're absolutly right that my solution relies on backslashes being used for quoting. If that changes, it would break, and thus I fully agree your conclusion about it not being an option.<br />
<br />
Actually, I wrote this 4 lines mainly because i've found this problem funny, but the implementation i really prefer is your original one with no printf (it's the easiest to read/understand imho, and sure it's also, by far, the fastest one).]]></content:encoded>
			<link>http://blogs.gentoo.org/agriffis/2006/02/07/requoting_in_bash#c2872</link>
		</item>
				<item>
			<title>In response to: requoting in bash</title>
			<pubDate>Wed, 08 Feb 2006 17:09:46 +0000</pubDate>
			<dc:creator>Aron Griffis [Member]</dc:creator>
			<guid isPermaLink="false">c2864@http://blogs.gentoo.org/</guid>
			<description>Hi TGL.  Your implementation makes assumptions about the quoting method used by printf %q, for example it assumes that the result will never contain &quot;&amp;lt;&amp;nbsp;&amp;nbsp;&amp;gt;&quot; for any possible &quot;$@&quot;.  This might be true at the moment, but it's an implementation detail of bash printf that is subject to change.  I appreciate the effort to remove the loop, but IMHO both of my previous implementations are better since they avoid the assumption.  Thanks!</description>
			<content:encoded><![CDATA[Hi TGL.  Your implementation makes assumptions about the quoting method used by printf %q, for example it assumes that the result will never contain "&lt;&nbsp;&nbsp;&gt;" for any possible "$@".  This might be true at the moment, but it's an implementation detail of bash printf that is subject to change.  I appreciate the effort to remove the loop, but IMHO both of my previous implementations are better since they avoid the assumption.  Thanks!]]></content:encoded>
			<link>http://blogs.gentoo.org/agriffis/2006/02/07/requoting_in_bash#c2864</link>
		</item>
				<item>
			<title>In response to: requoting in bash</title>
			<pubDate>Wed, 08 Feb 2006 01:19:49 +0000</pubDate>
			<dc:creator>TGL [Visitor]</dc:creator>
			<guid isPermaLink="false">c2858@http://blogs.gentoo.org/</guid>
			<description>This sequence works with no loop, but even more ugly:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
# quote the args, with a marker aroung each one&lt;br /&gt;
foo=$(printf '&amp;lt; %q &amp;gt;' &quot;${@}&quot;)&lt;br /&gt;
# reintroduce empty args if nothing in the middle of a marker&lt;br /&gt;
foo=&quot;${foo//&amp;lt;&amp;nbsp;&amp;nbsp;&amp;gt;/&amp;lt; '' &amp;gt;}&quot;&lt;br /&gt;
# tail of a marker + head of the next one =&amp;gt; space&lt;br /&gt;
foo=&quot;${foo// &amp;gt;&amp;lt; / }&quot;&lt;br /&gt;
# cleanup remaining half-markers on both sides of the string&lt;br /&gt;
foo=&quot;${foo#&amp;lt; }&quot; ; foo=&quot;${foo% &amp;gt;}&quot;&lt;br /&gt;
&lt;/blockquote&gt;</description>
			<content:encoded><![CDATA[This sequence works with no loop, but even more ugly:<br />
<blockquote><br />
# quote the args, with a marker aroung each one<br />
foo=$(printf '&lt; %q &gt;' "${@}")<br />
# reintroduce empty args if nothing in the middle of a marker<br />
foo="${foo//&lt;&nbsp;&nbsp;&gt;/&lt; '' &gt;}"<br />
# tail of a marker + head of the next one =&gt; space<br />
foo="${foo// &gt;&lt; / }"<br />
# cleanup remaining half-markers on both sides of the string<br />
foo="${foo#&lt; }" ; foo="${foo% &gt;}"<br />
</blockquote>]]></content:encoded>
			<link>http://blogs.gentoo.org/agriffis/2006/02/07/requoting_in_bash#c2858</link>
		</item>
			</channel>
</rss>
