title: Multiple shell script workers
body: <p><strong>We'd like to interpret tons of coordinates and do something with them using multiple workers.
  What we got:</strong></p>
  
  <p><strong>coords.txt</strong></p>
  
  <pre><code>100, 100, 100
  244, 433, 233
  553, 212, 432
  776, 332, 223
  ...
  8887887, 5545554, 2243234
  </code></pre>
  
  <p><strong>worker.sh</strong></p>
  
  <pre><code>coord_reader='^([0-9]+), ([0-9]+), ([0-9]+)$'
  while IFS='' read -r line || [[ -n "$line" ]]; do
      if [[ $line =~ $coord_reader ]]; then
  
          x=${BASH_REMATCH[1]}
          y=${BASH_REMATCH[2]}
          z=${BASH_REMATCH[3]}
          echo "x is $x, y is $y, z is $z"
  fi
  
  done &lt; "$1"
  </code></pre>
  
  <p>To execute <strong>worker.sh</strong> we call <code>bash worker.sh coords.txt</code></p>
  
  <p>Bc we have an amount of millions of coordinates it's needed to split the <strong>coords.txt</strong> and create multiple workers doing the same task, like <code>coordsaa, coordsab, coordsac</code> each 1 worker.</p>
  
  <p>So we split <code>coords.txt</code> using <code>split</code>.</p>
  
  <pre><code>split -l 1000 coords.txt coords
  </code></pre>
  
  <p>But, how to assign one file per worker?</p>
  
  <p><em>I am new to stackoverflow, feel free to comment so I can improve my asking skills.</em></p>