title: Command works in command line but gives 'no such file or directory' in bash script
body: <p>Like the tags say, this is in Cygwin.</p>
  
  <p>I have a command line program that I can run from the Cygwin console:</p>
  
  <pre><code>./optAlg.exe data/5Node/1.dat 500 2&gt;&amp;1 &gt; output/1.out
  </code></pre>
  
  <p>I wrote the following bash script to put it in a loop</p>
  
  <pre><code>#!/bin/bash
  
  for inputFile in data/5Node/*.dat
  do
    outputFile=${inputFile##*/} #strip output name from input name
    outputFile=${outputFile%.*} #strip output name input file
    outputFile+=".out"
    "./optAlg.exe $inputFile 500 2&gt;&amp;1 &gt; output/$outputFile"
  done
  </code></pre>
  
  <p>When I run the bash script, for every iteration of the for loop I get 'No such file or directory', e.g.,</p>
  
  <pre><code>./batchOpt.sh: line 8: ./optAlg.exe data/5Node/1.dat 500 2&gt;&amp;1 &gt; output/1.out: No such file or directory
  </code></pre>
  
  <p>What's happening here? What I'm not sure what I'm doing wrong.</p>