I find myself frequently doing the following:
for f in `find -foo -bar -baz`; do
process "$f"
done
This of course doesn't work for file names with spaces. How can I handle such cases?
Find and xargs work well together. find can print the names of the files with a \0-delimiter (option print0) and xargs can read them in that format (option -0):
find . -type f -print0 | xargs -0 echo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With