title: Too many open files error while running awk command
body: <p>I am trying to split a big file based on a pattern.
  I am using awk command for this. After creating certain number of files it gives error: Too many open files. </p>
  
  <p>Command is:</p>
  
  <pre><code>awk '/pattern here/{i++}{print &gt; "file"i}' /input file
  </code></pre>
  
  <p>Can someone tell me how to close these files? I tried following but it gives error.</p>
  
  <pre><code>    awk '/pattern here/{i++}{print &gt; "file"i}' /input file | close("file"i)
  </code></pre>