Looping through files bash script
Collating other folks' answers into a single one.
You've two problems with this script:
The script still has Windows line endings (that's what the
\r
refers to; it's the character that Windows has in its line endings, but Unix doesn't). bcarlso pointed that one out. Rundos2unix
over the script to sort it out.When assigning variables in a bash script, you cannot have spaces around the
=
sign. scibuff caught that one.The below gets interpreted as trying to run the command
FILES
(which doesn't exist) with the arguments= "/bowtie..."
.FILES = "/bowtie-0.12.7-win32/bowtie-0.12.7/output_635_25bp/*"
Whereas the below is interpreted as assigning
"/bowtie..."
to the variableFILES
:FILES="/bowtie-0.12.7-win32/bowtie-0.12.7/output_635_25bp/*"