I am trying to run a simple loop through all files script but it’s giving me the following error. The script is called test.sh and I am using Cygwin on Windows 7.
My script:
#!/bin/bash
FILES = "/bowtie-0.12.7-win32/bowtie-0.12.7/output_635_25bp/*"
for f in $FILES
do
echo "hello world"
done
The error is:
./test.sh: line 2: FILES: command not found
./test.sh: line 4: syntax error near unexpected token ``$'do\r''
./test.sh: line 4: ``do
Before running the script I converted all the files in folder to unix format using dos2unix command.
Try:
Thanks!
Brandon