[EMAIL PROTECTED] wrote on 02/08/2004 08:26:17 AM: > how can I loop on an intermediate dir name, I have dir tree structure as: > > /home/adomain.tld/logs > /home/b_domain.tld/logs > ... > > I'd like to run loop for all domains in that tree to run logresolve like > > logresolve < /home/$domain/logs/YYY-MM-DD.access.log > >/home/$domain/logs/YYY-MM-DD.access.rog > > and, how to reduce the YYY-MM-DD date by one day, I need to run this > against yesterdays' logs
I'm not exactly sure what you mean but is this what you want: #Script Start cd /home export DATE=`date -d yesterday +"%Y-%m-%d"` for i in `ls` ; do logresolve /home/$i/logs/$DATE.access.log >/home/$i/logs/$DATE.access.rog done #Finished Cheers, Scott -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html