Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 1 Apr 2005 10:36:12 -0700 To: bug-coreutils AT gnu DOT org, cygwin AT cygwin DOT com, Luke Kendall Subject: Re: Path confusion Message-ID: <20050401173612.GA8116@dementia.proulx.com> Mail-Followup-To: bug-coreutils AT gnu DOT org, cygwin AT cygwin DOT com, Luke Kendall References: <20050401071130 DOT 2051685080 AT pessard DOT research DOT canon DOT com DOT au> <424D4BA9 DOT 2010507 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <424D4BA9.2010507@byu.net> User-Agent: Mutt/1.5.8i From: bob AT proulx DOT com (Bob Proulx) 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/