X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=nWkJ JYsK64uPuZ7SbfD48Tp3O8YqkgXPmh4fK8Zwf+ncXYzTB8tlgRLhRUiBlHSHG9ah 2c3wde0dlvaMgQLqhZ/0Hvz5BtSRqmevu3u9Xe01V54XGTLpG5lYnH1Ft2UFfYUl qsOTm6x2FI9UtUfHAEnrvvBnLrzNhGnK91Ck4/M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=b81/pVKd5c yCpH0rzLtQNipogjc=; b=MH2OzdaEuqdGo3pkKeRU6uhH+xHJJ4gzMp+Qccun29 o+6nTvtvnNKfNtXhsLInWU8Kw36Fir/Ma03MiaAQJBcj5YxSGS7vE2MoPJxSw9ub nznxDXQNw3be0gEP+BsNQRy7R5H1PrdNP8Vz/So/N9NtiZpkg2rSKx5AsoydnOLI 4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Subject: Re: Calling cygpath from find exec? To: cygwin AT cygwin DOT com References: <56537B03 DOT 4050204 AT codespunk DOT com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Message-ID: <565383D5.3010709@redhat.com> Date: Mon, 23 Nov 2015 14:23:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56537B03.4050204@codespunk.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wD4SjRLdpfNv8J20oLMU4QWEQk7UT3uCK" X-IsSubscribed: yes --wD4SjRLdpfNv8J20oLMU4QWEQk7UT3uCK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/23/2015 01:45 PM, Matt D. wrote: > Is there a reason why these produce different results? >=20 > find . -exec cygpath -wa {} \; > find . -exec echo $(cygpath -wa {}) \; Incorrect quoting. You are invoking: find . -exec echo c:\cygwin\home\you\{} \; (or whatever ./{} resolves to), instead of one cygpath per name found by find. >=20 > I have to do this which is much slower: > find . -exec bash -c 'echo $(cygpath -wa {})' \; >=20 This indeed quotes things so that cygpath is now invoked once per file, but at the expense of an additional bash per file as well. Why not just: find . -exec cygpath -wa {} + since cygpath handles more than one file in an invocation (that is, using '-exec {} +' rather than '-exec {} \;' is generally faster). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wD4SjRLdpfNv8J20oLMU4QWEQk7UT3uCK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWU4PVAAoJEKeha0olJ0Nq5fUH+gP5RoNnPR8GFpHyMg0i0mvb 8qDbxzuvGIAMaE96CpEQVB+wbkCAQRF2WSRyyniRkHmsEbOgoXzFbRblfsS1LddW TiFGA8XG6cHPHgMp5bJhznud0G1mfwllJMIcOHFyoDqbGFmJABhRhXQ7Ms0nk2QO WZ4RRye5FUlHRzYhgqiHVyrgyTNhe6987mh9LaCnMCHS/1jG1POiE120upxhnY/N rk5vL0AmH5k2hDy5N/8z8LC9ajdVDi06pWJdlMSfuwDoGB5Izbfm4nP2cAy5/Nr3 4CXItlt3xdNKacWLgQGPZaURRXtYc1K50LK3S+ovVj6e2EFBapqrJTG6dhIqx5w= =peNO -----END PGP SIGNATURE----- --wD4SjRLdpfNv8J20oLMU4QWEQk7UT3uCK--