title: Running multiple program from bash script within for loop
body: <p>I'm trying to run multiple instances of a node server using a bash script. I parametrized node such that I could change the port at each cycle, but it seems I cannot run it properly. This is what I wrote (and doesn't start anything). It looks pretty ugly, I'm very new to bash scripting.</p>
  
  <pre><code>#!/bin/bash
  
  #iterate input times and start server
  COUNT=$1
  TIMEOUT=$2
  PORT=3000
  
  while [ $COUNT -gt 0 ]; do
          A="node server.js "
          B=PORT
          C=" "
          D=TIMEOUT
          CMD=$A$B$C$D
          $CMD
          let PORT=PORT+10
          let COUNT=COUNT-1
  done
  </code></pre>
  
  <p><code>TIMEOUT</code> is just another variable that I pass to the server instance. </p>
  
  <p>Can anyone point out what am I doing wrong? Thanks a lot, and sorry if the script looks ugly.</p>