On 11/23/2015 01:45 PM, Matt D. wrote: > Is there a reason why these produce different results? > > 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. > > I have to do this which is much slower: > find . -exec bash -c 'echo $(cygpath -wa {})' \; > 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). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature