Todd Andrews wrote: > 1) The command line using find gets a bit complicated when you need to > take into account file names with spaces, quotes, etc.
The 'find' command Eric proposed handled file names with spaces, quotes, etc. okay. There was no further complication. > Using a variation on what Pádraig Brady sent will take care of this: > > find data -type f -print0 | xargs -r0 cp -av --backup=numbered > --target-directory=alldata This can be written using POSIX standard 'find' syntax (which handles correctly names with spaces, quotes, etc.) as: find data -type f -exec cp -pv --backup=numbered --target-directory=alldata {} + Using 'find' is very powerful because it works with other programs without needing to modify those other programs. It applies a standard way of operating across files in the filesystem. > 2) Eric wrote, "Thanks for the suggestion. However, it seems like this > is already possible with existing tools, so why add the bloat?" > > Because I'm sure you'd agree having to use find + xargs + cp is not very > intuitive compared with "cp -pr --flatten data -t alldata" First no one suggested using xargs. (Although it is a traditional tool in this space. But find does it internally now and is standardized.) Second while I agree that the number of characters typed on the command line might be slightly less I think it is well worthwhile to use an interface that can be applied uniformly to a large set of utilities in a standard way. Trying to jam all possible behavior into all possible programs is counter to the Unix philosophy. http://www.faqs.org/docs/artu/ch01s06.html http://en.wikipedia.org/wiki/Unix_philosophy The way to design powerful programs is not to rewrite them with every possible behavior. The way to design powerful programs is to write them so that they can be used in combination in powerful new ways without needing to be rewritten. Bob _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils