Wednesday, September 09, 2009

Loop over filename with space

Instead of using
for x in $(find -depth 1 -type d); do
  ...
done
which breaks at space and therefore would fail for filename with space, do
find -depth 1 -type d | while read x; do
  ...
done

No comments: