title: Bash loop not working
body: <p>I am making a script that needs to loop over a list of files named
  like file1, file2, file3, all named the same with the suffix number increasing 
  according to users input.</p>
  
  <p>So I made thia script, but when I input number 3, she loops only 
  over file1 and it stops.
  Why?</p>
  
  <p>How do I make it loop over n files according to users input?</p>
  
  <p>This is my script:</p>
  
  <pre><code>    #!/bin/bash
      echo "Base name of machines to bring down:"
      read vm
      echo "Number of machines:"
      read num
  
      COUNTER=0
      while [  $COUNTER -lt $num ]; do
        num=$[$COUNTER+1]
        VBoxManage controlvm $vm$num poweroff
        let COUNTER=COUNTER+1
      done
  </code></pre>