On Wed, Feb 04, 2004 at 09:45:57AM +1100, Terry Collins wrote:
> find /spam -name smtpd*  -printf '  mv  {}  %AY%Am \n '
> 
> Is the bit in printf section complete? Do I need a shell command?
> 

Yeah, you need a shell.  You can feed the result of find
to sh with a pipe, but you're command needs a few fixes:
1. replace {} with %p
2. you probably want mod time, not access time, so %TY%Tm
3. quote the args in case the file contains spaces or other unpleasant chars

so, using echo instead of mv, and a throwaway file for testing,
we get:

        find crapola  -printf 'echo "%p"  "%TY%Tm" \n ' 

to execute the result, pipe to shell:

        find crapola  -printf 'echo "%p"  "%TY%Tm" \n '  |  sh
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to