see this script to fix webalizer to many users automatically.

nettcom

Active Member
Jul 5, 2003
29
0
151
have many users to fixwebalizer, bad using the script

#!/bin/sh
cd /home
for file in *
do
/scripts/fixwebalizer $file > script.log
sleep 2
echo $file
done

I have small problem, script stop when Found bad log files,
and when run again this script begin to fix from first user again

anyone have an idea to modify this script to read users to fix from a txt file

example:

format of list-of-users-to fix.txt

user1
user2
usern

script ;
-----------------
(I don know the correct programming procedure)
if any one can translate very thanks!

#!/bin/sh

open list-of-users-to fix.txt

read all lines

for $line
do
/scripts/fixwebalizer $file > script.log
sleep 2
echo $file

done


if any one helpme thanks!!
 
Last edited:

nettcom

Active Member
Jul 5, 2003
29
0
151
this is the script:

#!/bin/sh
cd /home
for file in *
do
/scripts/fixwebalizer $file > script.log
sleep 2
echo $file
done

we need modify this to read users from a file.txt
to fix one to one.

:)
 

asmithjr

Well-Known Member
Jun 13, 2003
516
8
168
something like this below.

cat file.txt | while read line
do
/scripts/fixwebalizer $line > script.log
sleep 2
echo $line
done


This will loop through the file reading line by line running the script.