On 3/19/19 10:56 AM, Budi wrote: > How to instruct 'find' to perform -exec with its argument is from > -printf, not from the default find output. > tried so far in vain: > find ~+ -type d -printf '%p /d/data/%p_%s\n' -exec cp \{\} \
You can't. But what you can do is: find ... -printf 'cp %p /d/data/%p_%s\n' | xargs -L1 where you instruct the -printf form to output the entire command you want executed (rather than trying to piece together the command with -exec), and instead have xargs execute it. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature