title: Multiple/divide columns in bash
body: <p>I have a dataframe looking like this: </p>
  
  <pre><code>ERR843978.19884 13 51 51
  ERR843978.2880 10 49 51
  ERR843978.10002 7 48 55
  ERR843978.1158 8 45 54
  ERR843978.4671 14 62 60
  ERR843978.83 15 56 70
  ERR843978.9406 8 56 39
  ERR843978.8383 12 59 43
  ERR843978.8916 6 51 42
  </code></pre>
  
  <p>and I wish to do this for all lines:</p>
  
  <pre><code>column2/(column3*column4)
  </code></pre>
  
  <p>and then print out the output in a new file.</p>
  
  <p>I've written a bash script that does it but it's kinda slow, so I'm looking at a more efficient solution (maybe with awk?).</p>
  
  <p>Here's my code</p>
  
  <pre><code>while read line
  do
          out0=$(awk '{print $1}' &lt;&lt;&lt; $line)
          out1=$(awk '{print $2}' &lt;&lt;&lt; $line)
          out2=$(awk '{print $3}' &lt;&lt;&lt; $line)
          out3=$(awk '{print $4}' &lt;&lt;&lt; $line)
          out4=`echo "scale=5; ($out1 / ($out2 * $out3))"|bc -l`
          echo "$out0;$out4"
  done &lt; $file
  </code></pre>