Can anybody tell me what is wrong with the following bash code
for f in $FILES
do
cut -d, f1-7 < $f > $f.tmp
done
When I run in the loop
echo "cut -d, f1-7 < $f > $f.tmp"
I get the right command output and when I run that command by itself, it works perfectly. But when I run it in the bash loop, it doesn't work, I get the following error:
cut: you must specify a list of bytes, characters, or fields
Try `cut --help' for more information.
Any ideas?