On Fri, Jul 23, 2004 at 05:46:22AM +1000, Ben de Luca wrote:
> simply
> 
> for FILE in `ls -1`
> do
> BASE=`echo ${FILE} | awk -F . '{print $1}'`

wouldn't it be better to use basename

BASE="$( basename $FILE '.log')"

just incase there are . in the filename 

> logresolve < $FILE > ${BASE}_r.log
> done
> 
> 
> 
> On 23/07/2004, at 1:19 AM, Voytek Eymont wrote:
> 
> >just another dumb question:
> >
> >I often use a 'runfor' utility, which I do not seem to have on the 
> >Linux
> >machine, how do I make a simple loop to catch up processing of web logs
> >with logresolve:
> >
> >I have a bunch of web logs in the format of:
> >
> >2004-05-31-access.log  2004-06-26-access.log  2004-07-11-access.log
> >2004-06-01-access.log  2004-06-27-access.log  2004-07-12-access.log
> >...
> >
> >I would like to logresolve them into say:
> >
> >2004-??-??-access_r.log
> >
> >like:
> >logresolve < 2004-05-31-access.log > 2004-05-31-access_r.log
> >
> >but, not quite sure how to loop it...?
> >-- 
> >Voytek
> >-- 
> >SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> >Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
> >
> 
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
> 

Attachment: signature.asc
Description: Digital signature

-- 
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