title: Bash: pass arguments from file line-by-line
body: <p>I am reading arguments from a file, line-by-line, but each line has several arguments. The gist of the code is below</p>
  
  <pre><code>cat file.txt | while read LINE ; do
      echo -e `./foo.sh "$COUNT" "$LINE"`
  done
  </code></pre>
  
  <p>foo.sh</p>
  
  <pre><code>#!/bin/bash
  echo "$2\t$3\t$4"
  </code></pre>
  
  <p>file.txt</p>
  
  <pre><code>0 0 0
  0 0 1
  0 1 0
  0 0 1
  </code></pre>
  
  <p>returned. Note it is not tabbed</p>
  
  <pre><code>0 0 0
  0 0 1
  0 1 0
  0 0 1
  </code></pre>
  
  <p>This is simpler example of what I'm trying to do; my foo.sh is actually making a sql call using the arguments. I know that my foo.sh function works through debugging, so I've narrowed it down to the line reader. Any help with where I'm going wrong?</p>