title: Concatenate arguments using a loop to form command in shell script
body: <p>I've tried different suggestions on this website and elsewhere but nothing has worked. I need to pass some arguments to a shell script and then concatenate them on a string to then launch it as a command. So I do this</p>
  
  <pre><code>command="perl perl_script.pl"
  
  for arg
  do
  
  command+="$arg "
  
  done
  
  eval $command
  </code></pre>
  
  <p>But I get this error</p>
  
  <pre><code>bowtie_script_simple.sh: 43: bowtie_script_simple.sh: comando+=-n : not found
  bowtie_script_simple.sh: 43: bowtie_script_simple.sh: comando+=3 : not found
  </code></pre>
  
  <p>According to other threads I've seen that should work. Any ideas?</p>
  
  <p>Thanks</p>