<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments for Andrew Birkett's blog</title>
	<link>http://www.nobugs.org/blog</link>
	<description>Thoughts of a software engineer</description>
	<pubDate>Thu, 28 Aug 2008 05:22:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>Comment on BBC invents new SI unit by Claire</title>
		<link>http://www.nobugs.org/blog/archives/2008/05/26/bbc-invents-new-si-unit/#comment-34234</link>
		<dc:creator>Claire</dc:creator>
		<pubDate>Tue, 27 May 2008 08:30:24 +0000</pubDate>
		<guid>http://www.nobugs.org/blog/archives/2008/05/26/bbc-invents-new-si-unit/#comment-34234</guid>
		<description>It's all part of the BBC's helpful strategy of taking easily understandable news stories and reporting them in such simple terms that they lose all meaning :-)</description>
		<content:encoded><![CDATA[<p>It&#8217;s all part of the BBC&#8217;s helpful strategy of taking easily understandable news stories and reporting them in such simple terms that they lose all meaning <img src='http://www.nobugs.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Squawk (simple queues using awk) by Andrew</title>
		<link>http://www.nobugs.org/blog/archives/2008/05/11/squawk-simple-queues-using-awk/#comment-33393</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 14 May 2008 11:37:24 +0000</pubDate>
		<guid>http://www.nobugs.org/blog/archives/2008/05/11/squawk-simple-queues-using-awk/#comment-33393</guid>
		<description>Ken:  Yep, that works fine if you are using netcat as a data source and filtering its output with awk.  But for squawk I also need the output from awk to be fed back into netcat's stdin - its a two way conversation.  I use netcat -c "my_awk_command" for this.  But that means my awk command invocation would need to be escaped otherwise bash will expand things like '$0' which I intend for awk.

Hmm, actually, I think in this case I can surround the awk invocation with single quotes and then consistently use double quotes within the awk script.  In an earlier version I was relying on the awk script being bash-expanded to do variable substitution for the queue name.  But now I explicitly pass the arguments in with --assign.

Ah, no .. I still need to shell-expand the --assign part of the awk invocation, so it can't be in single quotes.

This page has some suggestions; I'll see if I can get it to work: http://www.gnu.org/manual/gawk/html_node/Quoting.html.  I didn't know that if you run something like this:

ls 'foo'"bar"  (no space between the quotes)

.. then ls receives a single argument - I'd always assumed it'd get two arguments.</description>
		<content:encoded><![CDATA[<p>Ken:  Yep, that works fine if you are using netcat as a data source and filtering its output with awk.  But for squawk I also need the output from awk to be fed back into netcat&#8217;s stdin - its a two way conversation.  I use netcat -c &#8220;my_awk_command&#8221; for this.  But that means my awk command invocation would need to be escaped otherwise bash will expand things like &#8216;$0&#8242; which I intend for awk.</p>
<p>Hmm, actually, I think in this case I can surround the awk invocation with single quotes and then consistently use double quotes within the awk script.  In an earlier version I was relying on the awk script being bash-expanded to do variable substitution for the queue name.  But now I explicitly pass the arguments in with &#8211;assign.</p>
<p>Ah, no .. I still need to shell-expand the &#8211;assign part of the awk invocation, so it can&#8217;t be in single quotes.</p>
<p>This page has some suggestions; I&#8217;ll see if I can get it to work: <a href="http://www.gnu.org/manual/gawk/html_node/Quoting.html." rel="nofollow">http://www.gnu.org/manual/gawk/html_node/Quoting.html.</a>  I didn&#8217;t know that if you run something like this:</p>
<p>ls &#8216;foo&#8217;&#8221;bar&#8221;  (no space between the quotes)</p>
<p>.. then ls receives a single argument - I&#8217;d always assumed it&#8217;d get two arguments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Squawk (simple queues using awk) by ken horn</title>
		<link>http://www.nobugs.org/blog/archives/2008/05/11/squawk-simple-queues-using-awk/#comment-33390</link>
		<dc:creator>ken horn</dc:creator>
		<pubDate>Wed, 14 May 2008 10:11:41 +0000</pubDate>
		<guid>http://www.nobugs.org/blog/archives/2008/05/11/squawk-simple-queues-using-awk/#comment-33390</guid>
		<description>you can get away with this:
#! /bin/bash

(echo "GET / HTTP/1.0" ; echo "") &#124; nc www.yahoo.com 80 &#124; awk '
BEGIN{
  i=0
}
{
  print i++ "&#62;  " $0;
}' &#124; head -20

alternatively if you need more processing, use " instead or you can even process the current file and pipe it to awk if stdin is spare (i've used ## comments to give a grep target), using back ticks to get extra nested shells is a neat trick too..</description>
		<content:encoded><![CDATA[<p>you can get away with this:<br />
#! /bin/bash</p>
<p>(echo &#8220;GET / HTTP/1.0&#8243; ; echo &#8220;&#8221;) | nc <a href="http://www.yahoo.com" rel="nofollow">http://www.yahoo.com</a> 80 | awk &#8216;<br />
BEGIN{<br />
  i=0<br />
}<br />
{<br />
  print i++ &#8220;&gt;  &#8221; $0;<br />
}&#8217; | head -20</p>
<p>alternatively if you need more processing, use &#8221; instead or you can even process the current file and pipe it to awk if stdin is spare (i&#8217;ve used ## comments to give a grep target), using back ticks to get extra nested shells is a neat trick too..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on RAID-1 sans disks by Hugo</title>
		<link>http://www.nobugs.org/blog/archives/2008/03/20/raid-1-sans-disks/#comment-31421</link>
		<dc:creator>Hugo</dc:creator>
		<pubDate>Thu, 10 Apr 2008 09:16:45 +0000</pubDate>
		<guid>http://www.nobugs.org/blog/archives/2008/03/20/raid-1-sans-disks/#comment-31421</guid>
		<description>that's cool!
very elegant way of working with both bash and lo</description>
		<content:encoded><![CDATA[<p>that&#8217;s cool!<br />
very elegant way of working with both bash and lo</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Polymorphic function; a tale of two forM_&#8217;s by Porges</title>
		<link>http://www.nobugs.org/blog/archives/2008/02/05/form_-vs-form_/#comment-31266</link>
		<dc:creator>Porges</dc:creator>
		<pubDate>Sun, 06 Apr 2008 10:14:48 +0000</pubDate>
		<guid>http://www.nobugs.org/blog/archives/2008/02/05/form_-vs-form_/#comment-31266</guid>
		<description>Ah, I had a similar issue earlier. I was looking for forM_ over a Map and found it in the Traversable class... as forM, with no forM_ to be found.

Now I know I should have been looking in Foldable all along...!</description>
		<content:encoded><![CDATA[<p>Ah, I had a similar issue earlier. I was looking for forM_ over a Map and found it in the Traversable class&#8230; as forM, with no forM_ to be found.</p>
<p>Now I know I should have been looking in Foldable all along&#8230;!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
