title: Tomcat 7 BASH CP copies filename but not the file content?
body: <p>I have a peculiar issue:</p>
  
  <p>The following BASH script worked fine under Tomcat 5.
  When the Tomcat 5 was upgraded to Tomcat 7, the script fails.
  (It may be a coincident, I don't know)
  The script is started by a response.sendRedirect() statement in a servlet.</p>
  
  <p>The BASH script executes the CP command twice (count = 0, 1).
  First time (count = 0) the CP command is executed as expected.
  Second time it copies only the filename but not the content of the file.</p>
  
  <pre><code>count=0;
  while [[ $count -lt ${#param[*]} ]]; do
    echo "cp $dirfrom${param[$count]} $dirto${param[$count]}&lt;br&gt;"
    case ${param[$count]} in
      *.jpg) cp $dirfrom${param[$count]} $dirto${param[$count]} ;;
      *.gif) cp $dirfrom${param[$count]} $dirto${param[$count]} ;;
    esac
    let count++
  done
  </code></pre>
  
  <p>As you see, I have a test output line at line 3. If I executes the echoed CP in line 3 manually, the CP executes as expected.</p>
  
  <p>Any clues?</p>