title: What is the wrong with the script
body: <p>My script is throwing an error in Bash:</p>
  
  <pre><code>/tmp/hudson6482258714933636361.sh: line 7: ((: i &lt;=  : syntax error:operand expected (error token is "&lt;=  ")
  cp: cannot stat 
  
  ‘/var/jenkins_home/jobs/Latha/jobs/ShirePoc/jobs/RetrieveJob/workspace/Deploy/retrieveUnpackaged/*’: No such file or directory
  </code></pre>
  
  <p>Here is the script:</p>
  
  <pre><code>COUNT= $(ls -1 | wc -l)
  echo $COUNT
  for (( i=1 ; i &lt;= $COUNT ; i++ ));
  do
    var=package$i.xml
    echo "FILENAME is $var"
    mv -f $var package.xml
    mkdir ${WORKSPACE}/Deploy/unpackaged
    cp -R ${WORKSPACE}/tools/Package/package.xml ${WORKSPACE}/Deploy/unpackaged/
    cd ${WORKSPACE}/Deploy/unpackaged 
    cat package.xml
    ls -ltra
    cd ${WORKSPACE}/Deploy/
    ls -ltr
    ant -buildfile build.xml RetrieveComponent
  done
  </code></pre>
  
  <p>Why is the script causing an error?</p>