Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ok let met explain the problem from begining :
in my page i have forms that allow the user to chose the report month and year and when the user will submit that the page will bring a full report of his traffic on that time.
what i want to do is that :
when the user will chose the month the code will search in the log files created on that time and send their contents tot calamaris for specific user:
<code>Code: Select all
echo shell_exec("cat `ls `find ./logs -name access.log.* ` -l | grep May | awk '{print $9}'`| grep akadi_icho | /usr/bin/perl ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html");but because the following command:
<code>
Code: Select all
ls ./logs -l | grep May | awk '{print $9}'
access.log.81
access.log.82
access.log.86it is not giving the path so the cat can't be executed (here i put for May just as example ), so i have used the command in this way combined with find command to get the path of the files:
<code>
Code: Select all
ls `find ./logs -name access.log.*` -l | grep May | awk '{print $9}'
./logs/access.log.81
./logs/access.log.82
./logs/access.log.86now i want to send the contents of this file to calamaris for specific user such akadi_icho, but i don't know why cat is not working so , i tried the following way:
<code>
Code: Select all
cat ./logs/`ls ./logs -l | grep May | awk '{print $9}'` | grep saro_der_avanesian
output is :
ages/letters/black/239.gif saro_der_avanesian FIRST_PARENT_MISS/proxy.aic.net image/gif
1178460942.330 848 10.2.0.181 TCP_MISS/200 459 GET http://www.google-analytics.com/__utm.gif? saro_der_avanesian FIRST_PARENT_MISS/proxy.aic.net image/gif
cat: access.log.82: No such file or directory
cat: access.log.86: No such file or directoryit is searching in the first file just , [s]u[/s] you can see that it didn't iterate for the second and third file , so what should i do .
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]11.[/b] Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.[/quote]