0

I have the following function to recursively find files, yet it does not work when there are spaces in the file names. What am I doing wrong here?

for f in "$(find "$1" -type f -name '*.*')"
do
  echo "Processing $f file..."
done
noway
  • 2,585
  • 7
  • 41
  • 61
  • It looks like your question has an answer [here](http://stackoverflow.com/q/11366184/1426891); I have a slight improvement that I'll post there as well. Good luck! – Jeff Bowman May 19 '14 at 23:12
  • Thanks @JeffBowman, I couldn't find that question at my first search.. – noway May 19 '14 at 23:17

1 Answers1

0

You have to tweak the IFS variable, as space is taken as a separator by default.

All explanations and different solutions can be found here. http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html