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 \{\} \
On 3/19/19, Budi <budikus...@gmail.com> wrote: > How do we make '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 \{\} \; > > Thanks! > > > > On 3/16/19, Dale R. Worley <wor...@alum.mit.edu> wrote: >> I think what you are asking for is something like: >> >> i=0 >> while ... >> do >> find . -mindepth $i -maxdepth $i ... >> i=$(( i+1 )) >> done >> >> That will look at all the files and directories at one depth before >> looking at all the files and directories at the next greater depth. (It >> doesn't have any way of testing when i is larger than the depth of the >> file tree.) >> >> Dale >> >