Eric Blake wrote: > [moving feature request portion of thread to bug-coreutils] > > According to Luke Kendall on 4/1/2005 12:11 AM: > >>>> find / -xdev -user "$USER" -print0 | xargs -0 chown Administrators.SYSTEM > >>> > >>> You must mean 'chown -R --from="$USER" ...' :-) > >> > >> Hmm, sounds better still. :-)
No, that sounds worse. Using 'find' is a shared and powerful interface to all of the tools. Adding all of find's features to every tool is bad. It bloats every tool. Even if you are careful with options there will eventually be conflicts leading to unique implementations in every tool. It violates the GNU/UNIX principle of modularity where small tools are used to create more powerful tools. Using find is also more maintainable because in the future as a new feature is required or added to filesystem traversal, such as your -xdev option, it is then available to all uses of it. If those features were added to individual tools such as grep and chown and diff and snurble then every single command in the world would need to have that feature added individually. There is no leverage in that case. > > D'oh! Not possible: there's no -xdev option on chown, so that would > > do a whole lot more chown-ing than intended, as it reached across the > > network, or at least into other mount points under "/" ... > > How about it - does it make sense to add an --xdev option to all of the > recursive descent tools (chown, chmod, ls, ...) to force the recursion to > stop at mount points, or is find/xargs the only supported idiom for this? Please no. The find command already implements all of those features and many more. Is it even a possible task to enumerate all of the tools, not just coreutils but all of the project tools, that have directory traversal built into them? If you have a hard time enumerating them then attempting to make a global change across them is even more difficult. Bob -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/