View Single Post
Old 2004-07-13, 07:29 AM   #7
spacemanspiff
Where there's a will, I want to be in it.
 
spacemanspiff's Avatar
 
Join Date: Aug 2003
Location: Looz-e-anna
Posts: 1,015
Send a message via ICQ to spacemanspiff
Ok, next stupid question. The script gets a list of domains to search for in the raw log files from a text file called domains.txt. The command is something like:

analyzelogs.sh domains.txt

What I don't understand is why the names change. In the second line, the first input variable (did I say that right?), $1 is assigned the name "serverlist" yet when the time comes for the while loop, which scans the logs looking for each individual domain, it seems to change to "servername". Shouldn't those be the same?

serverlist = $1
while read serverlist
do some stuff


In case anyone is wondering, this scipt was written by a former tech, and works great on a dedicated server with a single raw log file. I'm trying to modify it for use on a virtual account where I have access to the raw logs, but each domain has it's own file.

I seem to be getting stuck in an endless loop. I pared the thing down to just try and read the domains.txt file and print out the names of the domains on the list with no more processing.

#!/bin/bash
serverlist=$1
sst="/web/sites/sitestatstable/index.html"
printf "Analyzing the Log Files...one moment please"

while read servername

do
printf $servername

if [ -f /var/log/apache/$servername ]
then
printf "Y"

else
printf "N"

fi

done




No luck.
__________________
Submit your free sites to Free Sex Pics
spacemanspiff is offline   Reply With Quote