Quote:
Originally Posted by yah0m
files="`cat /usr/local/apache/domlogs/domain.com | grep '"-" "-"' | awk {'print $1'}`"
for f in $files; do
csf -d $f
done
I know I want to use tail -f but not sure how.
|
What is
csf ?
Anyway, to monitor:
Code:
watch "cat /usr/local/apache/domlogs/domain.com | grep '\"-\" \"-\"' | awk {'print $1'}"
Note: escape the double quotes inside the grep command with a backslash.
BTW cat-ing into grep is not necessary, as grep can read from a file itself:
Code:
watch "grep '\"-\" \"-\"' /usr/local/apache/domlogs/domain.com | awk {'print $1'}"
Also, if you're already using awk, you might as well skip the grep too, leaving just one awk-command to do the job:
Code:
watch "awk '/\"-\" \"-\"/ {print $1}' /usr/local/apache/domlogs/domain.com"
BTW It would be very well possible also to do it with only one sed command instead of awk.