find ... | while read -r dir do something with "$dir" done
Friday, 25 April 2014
for loop with spaces
I used to use a "for"-loop over a result of a `cat file` in order to apply on each line. But this does not work very well with spaces... Therefore I looked for a better solution which I kept forgetting. The trick is to use the "read command a in the example below:
Labels:
bash,
for loop,
while loop