On 5/25/06, Michael Sternberg <[EMAIL PROTECTED]> wrote:
I need to perform some task on specific files recusrsively. Problem is
that directories names can contain spaces. Something like that (in
/bin/sh) does not works:

for f in `find .  -name '*.c*'`; do file $f; done

That's what "find -print0" and "xargs -0" were invented for:

find -name "*.c*" -print0 | xargs -0 -n 1 file

will do the same as your sample.
Since "file" can take multiple file names you can drop the "-n 1".

("." as the only path for "find" is pre-gnu-find legacy, you don't need it)

--Amos
--
"(a grizzly) can tear through a tree like a Jewish mother
through self-esteem."              - The Simpsons

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to