title: Iteration and moving files in Bash
body: <p>I am trying to write a script that will accomplish:</p>
  
  <ol>
  <li><p>Read all files in directory</p></li>
  <li><p>If a file is equal to one of the specified files, rename it and move it to directory XXX</p></li>
  </ol>
  
  <p>I got the loop to iterate over the files but it keeps giving me an error.</p>
  
  <pre><code>#!/bin/bash
  
  for i in `ls`
  do
    if [  '$i'  -eq 's1' -o  '$i'  -eq 's2' -o  '$i'  -eq 's3'  ]; then
  
       #rename file and move it to XXX
  
    fi
  done
  </code></pre>
  
  <p>this gives me an error of loops: line 6: [: $i: integer expression expected</p>
  
  <p>Also how would I change the name of the iterator <em>i</em> to names like t1, t2, t3</p>
  
  <p>ie. if the iterator is holding the value of s1 I want to rename it to t1.</p>