Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:36 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc