Re: Announcing RemoveSVN
Re: Announcing RemoveSVN
- Subject: Re: Announcing RemoveSVN
- From: Sherm Pendley <email@hidden>
- Date: Mon, 5 Nov 2007 08:32:52 -0500
On Nov 5, 2007, at 6:59 AM, Johan Claesson wrote:
Once upon a time Chris Woods wrote:
On Nov 5, 2007, at 4:51 AM, Johan Claesson wrote:
Once upon a time Sherm Pendley wrote:
You can do the same thing with a simple shell command, which works
not only in any version of Mac OS X, but in any other *nix as well:
find /path/to/folder -name '.svn' | xargs rm -r
Or more correct:
find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;
TIMTOWTDI.
It's difficult to make a case for "more correct" when both work
(except yours wouldn't, since it wouldn't remove anything unless you
had plain files with that name).
In general, xargs is more efficient anyway. With the -exec option
passed to find, you're performing the command you're passing to exec
anew with each result that find turns up. When you use xargs, you're
building up the argument list using find, passing it en masse to
xargs, which then passes the list en masse to whatever you're doing
with the argument list, in this case 'rm'.
This is rather OT, but xargs won't work if you have file or directory
names with spaces in them.
Really?
find /path/to/folder -name '.svn' -print0 | xargs -0 rm -r
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden