I often do the following:
for f in `find -foo -bar -baz`; do process "$f" done
This, of course, does not work for file names with spaces. How can I handle such cases?
find . -type f | while read file; do process "$f" done;
Find and xargs work together. find can print file names with \0-delimiter (option print0), and xargs can read them in this format (option -0):
\0
print0
-0
find . -type f -print0 | xargs -0 echo
find, exec
find -foo -bar -baz -exec process '{}' \;
IFS ( )
bash 4
shopt -s globstar for file in /path/** do process "$file" done
for , .
for
Then inside the loop I will replace this particular line with a space.
Example:
list=`find -foo -bar -baz | tr ' ' 'µ'` for fx in $list ; do f=`echo $fx | tr 'µ' ' '` process "$f" done
Source: https://habr.com/ru/post/1733002/More articles:How to use NSArrayController associated with NSUserDefaultsController with a custom class - objective-cstruts reset() не вызывается перед заполнением формы - strutsDraw a line in TextBox C # (.NET 3.5) - c #Number of lines of code in a RAD / Eclipse workspace - eclipseHow to create a tab-delimited txt file? - c #Amazon S3 Integration - javaProblem with java utf-8 - javaMaven and Eclipse problem - finding resources - javaNULL in an array of strings - c #How to fix IE7 floating point combination - cssAll Articles