I’m trying to write a Bash script to convert a bunch of files.
Assume I have a directory /path/to/my files/ with three text files: a b.txt, c d.txt and e.txt (note the spaces)
I need to be able to call the script like this:
$ ./myscript.sh /path/to/my\ files/*.txt
and then loop through them in bash to process them like this:
dest='/desktop/'
for ARG in $@; do
/some/other/script $ARG $dest$ARG.new
done
It doesn’t have to work exactly like this, whatever is easiest that will yield similar results
Does this do what you need:
EDIT: To remove the path on ARG