Modify terminal .command file to run on multiple files
The only line that does work in that script is

xattr -c "$FILE"


To run a command on all files in a folder, use find:

find /path/to/folder -type f -exec xattr -c "{}" \;


xattr also provides the -r flag to run recursively, so you can avoid find given that this functionality is part of xattr:

xattr -rc /path/to/folder