To use xargs safely you use the -print0 option to find and the -0 option to xargs.
But there's no need to use find/xargs. To magically look after the directory bits, you use the chmod big X option rather than the small x. Big X sets x if any other x is set. This will do the right thing in the sense that the result would be the same if you set the desired umask before creating the files: $ umask 0007 $ touch crap1 $ mkdir crapdir $ ls -l total 4 -rw-rw---- 1 mlh mlh 0 Aug 12 20:54 crap1 drwxrwx--- 2 mlh mlh 4096 Aug 12 20:54 crapdir $ chmod -R o+rX . $ ls -l total 4 -rw-rw-r-- 1 mlh mlh 0 Aug 12 20:54 crap1 drwxrwxr-x 2 mlh mlh 4096 Aug 12 20:54 crapdir Matt -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
