From owner-freebsd-questions@FreeBSD.ORG Wed Jul 16 07:01:11 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 719611065675 for ; Wed, 16 Jul 2008 07:01:11 +0000 (UTC) (envelope-from beech@freebsd.org) Received: from bsdevel.alaskaparadise.com (bsdevel.alaskaparadise.com [208.86.224.193]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3628FC08 for ; Wed, 16 Jul 2008 07:01:11 +0000 (UTC) (envelope-from beech@freebsd.org) Received: from stargate.alaskaparadise.com (132-34-178-69.gci.net [69.178.34.132]) by bsdevel.alaskaparadise.com (Postfix) with ESMTP id AD47128E294C; Wed, 16 Jul 2008 07:01:10 +0000 (UTC) From: Beech Rintoul To: freebsd-questions@freebsd.org Date: Tue, 15 Jul 2008 23:01:03 -0800 User-Agent: KMail/1.9.7 References: <20080714201241.GA22443@thought.org> <20080716114210.59372334@ayiin> <1216189379.81342.23.camel@predator-ii.buffyverse> In-Reply-To: <1216189379.81342.23.camel@predator-ii.buffyverse> X-Face: jC2w\k*Q1\0DA2Q0Eh&BrP/Rt2M,^2O#R07VoT98m*>miQF9%Bi9vy`F6cPjwEe?m,)=?utf-8?q?2=0A=09X=3FM=5C=3AOE9QgZ?="xT3/n3,3MJ7N=Cfkmi%f(w^~X"SUxn>; 27NO; C+)g[7J`$G*SN>{<=?utf-8?q?O=3Bg7=7C=0A=09o=7D=265A=5D4?=@7D`=Eb@Zs1Ln814?]|k@'bG=.Ca"[|8+_.OsNAo8!#?4u MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807152301.06856.beech@freebsd.org> Cc: Subject: Re: why is this script failing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Beech Rintoul List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2008 07:01:11 -0000 On Tuesday 15 July 2008, Wayne Sierke said: > On Wed, 2008-07-16 at 11:42 +1000, Norberto Meijome wrote: > > you can always do > > > > find /tmp/kde-*/ -iname "*wav" -print0 | xargs -0 rm -vf > > > > the advantage over doing using rm * or for * in ... is that if > > you have LOTS of files, the expanded list of files may be too > > much. find | xargs will deal with each file in turn. ( -print0 > > and -0 is to use NULL char as a list delimiter instead of > > space... ). > > Note that - as highlighted in previous discussions on the fbsd > lists re the use of xargs with find - find is eminently capable of > handling large argument lists and filenames_with_spaces with its > own -exec primary: > > find /tmp/kde-*/ -iname "*wav" -exec rm -vf {} \; > > to exec rm for each file individually, or: > > find /tmp/kde-*/ -iname "*wav" -exec rm -vf {} \+ > > to exec rm for multiple files at once. > > Piping to xargs in this case is unnecessary. > > And for things like those pesky .SVN dirs in a port: find /usr/ports/foo/work -depth -type d -name .SVN -exec rm -rf {} \; Beech -- --------------------------------------------------------------------------------------- Beech Rintoul - FreeBSD Developer - beech@FreeBSD.org /"\ ASCII Ribbon Campaign | FreeBSD Since 4.x \ / - NO HTML/RTF in e-mail | http://www.freebsd.org X - NO Word docs in e-mail | Latest Release: / \ - http://www.FreeBSD.org/releases/7.0R/announce.html ---------------------------------------------------------------------------------------