Here is something strange.
mkdir -p \"1/2 3/4\"
touch 1/2\\ 3/4/file.jpg
for f in $(find . -type f -name \\*jpg); do echo \"${f}\"; done
Th
You can use the -print0
option along with xargs -0
. For instance:
find . -type f -name \*.jpg -print0 | xargs -0 echo
This would work no matter the content of the file names (even newlines would be handled correctly).
See the difference between:
find . -type f -name \*.jpg -exec echo {} \;
and:
find . -type f -name \*.jpg -exec echo \"{}\" \;
It can be done in several ways, but I find it much better to do it this way:
find . -type f -name \*.jpg | while read i ; do echo "Procesing $i..." ; done