<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenAL on Amit Agarwal Linux Blog</title>
    <link>/tags/openal/</link>
    <description>Recent content in OpenAL on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 11 Jun 2011 02:11:53 +0000</lastBuildDate>
    
	<atom:link href="/tags/openal/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>faster bash operations on files with File Descriptors.</title>
      <link>/2011/06/11/faster-bash-operations-files-file-descriptors/</link>
      <pubDate>Sat, 11 Jun 2011 02:11:53 +0000</pubDate>
      
      <guid>/2011/06/11/faster-bash-operations-files-file-descriptors/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was &lt;a class=&#34;zem_slink&#34; title=&#34;Writing&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Writing&#34;&gt;writing&lt;/a&gt; a &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash script&lt;/a&gt; that would do some operations and read and write to file. Seems that that was pretty simple with&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      while read line&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; done&amp;lt;file
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;and then use redirection operations like “&amp;gt;” and “&amp;raquo;” to write to file. Done with the script pretty fast. So far so good, when I went for real life tests, no one was interested in using it, why? Simple, it was simply taking too long. The file was reading about 10K lines and writing about 50 lines and was taking about more than 10 minutes.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
