<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Averaging text files with bash and awk</title>
	<link>http://claus.castelodelego.org/archives/539</link>
	<description>Claus' little corner on the net</description>
	<pubDate>Wed, 08 Feb 2012 04:26:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Claus</title>
		<link>http://claus.castelodelego.org/archives/539#comment-45212</link>
		<author>Claus</author>
		<pubDate>Mon, 19 Apr 2010 09:35:15 +0000</pubDate>
		<guid>http://claus.castelodelego.org/archives/539#comment-45212</guid>
		<description>Oh my. Thanks for the comment Pat! Good thing I did not publish these results yet :-). That's what I get for trying to hammers voodoo recipes without fully understanding them.

There is another error in the above code. Calling "$ ./average.sh filename.*" will expand to the first file name, which will average a single file. You need to put "filename.*" in "" in order to prevent it from expanding until it enters the script.

Fixing now.</description>
		<content:encoded><![CDATA[<p>Oh my. Thanks for the comment Pat! Good thing I did not publish these results yet :-). That&#8217;s what I get for trying to hammers voodoo recipes without fully understanding them.</p>
<p>There is another error in the above code. Calling &#8220;$ ./average.sh filename.*&#8221; will expand to the first file name, which will average a single file. You need to put &#8220;filename.*&#8221; in &#8220;&#8221; in order to prevent it from expanding until it enters the script.</p>
<p>Fixing now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat</title>
		<link>http://claus.castelodelego.org/archives/539#comment-45206</link>
		<author>Pat</author>
		<pubDate>Thu, 15 Apr 2010 20:42:14 +0000</pubDate>
		<guid>http://claus.castelodelego.org/archives/539#comment-45206</guid>
		<description>Does finding a bug get bonus points? You actually want to pass fld to awk as well (say -v fld="$fld") and then do

ta=f+i*fld

instead of ta=f. Right now tta is just adding the 'f'th entry s times and dividing it by s, giving back the 'f'th entry.</description>
		<content:encoded><![CDATA[<p>Does finding a bug get bonus points? You actually want to pass fld to awk as well (say -v fld=&#8221;$fld&#8221;) and then do</p>
<p>ta=f+i*fld</p>
<p>instead of ta=f. Right now tta is just adding the &#8216;f&#8217;th entry s times and dividing it by s, giving back the &#8216;f&#8217;th entry.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

