custom awstats scripty type thing

Ok.. so im after ideas.. my bash coding isnt to crash hot so an alternative would be great.. but heres what i want

i use static awstats pages to show my stats for my site and others that i host, i have config files that look like this

awstats.example1.com.conf
awstats.example2.com.au.conf
awstats.example3.com.au.conf
awstats.example4.com.au.conf
awstats.conf.local

Basicly

i have to call the program

/usr/lib/cgi-ban/awstats_buildstaticpages.pl -config=example1.com -dir=/home/hosting/example1.com/www/stats 

a few other paramaters have to be called but nothing important

basicly i want to automate it so i want someway of replacying example1.com with one of other sites as listed in the directory.

Im thinking like looping through the directory passing for files that have awstats* and *.conf and using the middle bit as the identifier for everything, but im not sure how to do that..

any suggestions?

1 Reply

for i in $( ls | grep awstats); do

echo item: $i # replace this line with your line

done

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct