This should be a relatively simple question. I am trying to pass multiple files through an executable program in a loop. I have tried multiple strategies (storing in an array, etc.) but the file name does not seem to be recognized as a variable. The error I am getting is: No such file or directory.
The outline of my latest attempt:
FILES=path/*/*
for f in $FILES
do
./function -input $f
done
I am working in a bash shell.
./function
looks more like an executable program. (function
by itself would be shell syntax for defining a function) – ilkkachu Nov 30 '17 at 17:22./function -input "$f"
. Try running the script withset -xv
to see how the variables are really populated. – choroba Nov 30 '17 at 17:29