title: cannot open pipe too many open files
body: <p>I am getting error,</p>
  
  <p>fatal: cannot open pipe (Too many open files)</p>
  
  <pre><code>#!/bin/bash
  output="Out.txt"
  trans="DEBIT_TRANSACTION_"
  ls *.txt | while read line
  do
   subName="$(cut -d'.' -f1 &lt;&lt;&lt;"$line")"
  
  awk -F"|" -v var="10|" 'NF!=15;  NF==15 &amp;&amp; /^[^[:space:]]/{ "echo -n "$6" | tail -c 3" | getline terminalCountry;
      if($6 =="") terminalCountry="IND";
    $1=var$1;$6=$6"|"terminalCountry; print $0;
  }' OFS="|" "$line" &gt; /home/lradmin/script/cboiCC/cboicTxnScrip/OUTPUT/"$subName$output"
  
  done
  </code></pre>