well the file names appear to be well structured, and I have never seen the basename cmd before :). I use types of unix how common is the command? it looks like it have been around for a while.

if i was worried about extra .  I might use.
BASE=`echo ${FILE} | awk -F ".log$" '{print $1}'






On 23/07/2004, at 7:49 AM, Alexander Samad wrote:

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

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

Reply via email to