Hi there... I'm not a good scripter (as will be obvious here lol)... trying to build a simple script that will:
Generate a directory list, search inside of each directory for a specific file (if it exists), and then search that file for matching criteria. In this particular example I'm searching for specific IP addresses throughout 300+ apache access logs.
Here's what I have created and I'm having a problem that I'm sure will be obvious..
#!/bin/sh
for dir in '/bin/ls /home/httpd/vhosts'
do
find /home/httpd/vhosts/$dir/statistics/logs/ -name access_log -exec \
egrep -il "193.169" {} \;
done
Output breaks with the following:
find: /home/httpd/vhosts//bin/ls: No such file or directory
find: /home/httpd/vhosts/statistics/logs/: No such file or directory
So it seems that the dir variable isn't passing two lines down or am I missing something here?
Any and all suggestions/help is most welcome.
Paul