Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 2004 17:28:57 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Denis Antrushin <DAntrushin@mail.ru>
Cc:        Alfred Perlstein <alfred@freebsd.org>
Subject:   Re: RFC: "-exit" option for find(1)
Message-ID:  <20040716142856.GA1589@straylight.m.ringlet.net>
In-Reply-To: <40F78A8F.2010502@mail.ru>
References:  <20040716071545.GW95729@elvis.mu.org> <20040716072341.GX95729@elvis.mu.org> <40F78A8F.2010502@mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=windows-1251
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 16, 2004 at 11:58:07AM +0400, Denis Antrushin wrote:
> Alfred Perlstein wrote:
> >I'm up too late, this doesn't work because find returns
> >success whenever it successfully runs thought everything.
> >
> >Perhaps the primary change to just "-exit" which would
> >make find exit successfully, and if the primary is never
> >encountered (ie. our find logic never hits it) find would
> >exit with a non-zero exit status?
> >
> >Ideas?  Better ideas?
> >
> >The reason I want this is to avoid extracting a tarball
> >over a directory that has files in it that are newer than
> >the tarball.
> >
> >Neither tar nor find seem to make this easy...
> What about this:
>=20
> test -n "`find . -type f -newer ../src.tar.gz`" && echo hi

I believe Alfred's problem with this is that it will still traverse the
whole hierarchy even after a match is found.  In some cases, the
hierarchy may be huge, and if the match is within the first 100-200
files, well... :)

I wonder if it wouldn't be a bit better to add to find(1) something like
-maxmatches N, similar to Alfred's idea, but not limited to a single
match?

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
No language can express every thought unambiguously, least of all this one.

--cNdxnHkX5QqsyA0e
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFA9+Yo7Ri2jRYZRVMRApPmAKDDW+NAcRPE1UrP9t9sIGhYzdPWJACffgRd
DD6PKCCpnc0RsulKcFK269o=
=fTOe
-----END PGP SIGNATURE-----

--cNdxnHkX5QqsyA0e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040716142856.GA1589>