From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QjEzX-0007g1-BS for garchives@archives.gentoo.org; Tue, 19 Jul 2011 18:25:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7B9A421C060; Tue, 19 Jul 2011 18:25:49 +0000 (UTC) Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com [209.85.215.53]) by pigeon.gentoo.org (Postfix) with ESMTP id E989C21C044 for ; Tue, 19 Jul 2011 18:24:55 +0000 (UTC) Received: by mail-ew0-f53.google.com with SMTP id 8so192141ewy.40 for ; Tue, 19 Jul 2011 11:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=2uiqv5w+3E3us/0oNAblNlRDDPCUtPk7DYv5U3EDFRA=; b=qsh1KqHMwUS/5NHU4dvyyRxETh0XnTO7hU9oc1weDNipQ/taJxYYxGPXAlAEQSu6Sa 7HNEKMBvea9r1xlHfLioabwtj8bDxJPwP3gM8G9j7WpuFRaKG04oOChxuHuk1uimGM2y ZU0Ur1QGv0I/g50vmsYup3eRnZblLhg3xGdP0= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.14.37.65 with SMTP id x41mr323044eea.177.1311099895441; Tue, 19 Jul 2011 11:24:55 -0700 (PDT) Received: by 10.14.50.203 with HTTP; Tue, 19 Jul 2011 11:24:55 -0700 (PDT) In-Reply-To: <4E258D94.1090707@binarywings.net> References: <20110717205303.6263aa02@karnak.local> <16810050.Acf57OJLs1@nazgul> <1310951110.304502.9.camel@localhost.localdomain> <20110718094824.079dce7a@zaphod.digimed.co.uk> <4E258D94.1090707@binarywings.net> Date: Tue, 19 Jul 2011 11:24:55 -0700 Message-ID: Subject: Re: [gentoo-user] Any way around "Argument list too long"? From: Grant To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: d3d5b88609303eaab8d60110671d4946 >>> Alright, find is tricky. =A0Is this the right spot for -delete? >>> >>> /usr/bin/find /home/user -type f -name "*-`/bin/date -d 'yesterday' >>> +\%Y\%m\%d`*.jpg" - delete >> >> Yes, but if you don't want irreversible mistakes, move the files instead= . >> >> find /home/user -type f -name blah -exec mv -t ~/.Trashcan "{}" + >> >> > > In all these commands it would always be a good idea to deactivate > parameter parsing just in front of the place where the file names are > inserted. > > find ... -print0 | xargs -0 mv -t ~/.Trashcan -- > or > find ... -exec mv -t ~/.Trashcan -- "{}" + > > The double dash will prevent mv from interpreting weird file names like > "-h" as parameters. Just about every standard GNU tool supports this. Does that apply to a command like this: /usr/bin/find /home/user -type f -name "*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg" -delete Maybe it should be changed to this: /usr/bin/find /home/user -type f -name -- "*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg" -delete - Grant