I want to process all changed logfiles from apache and made a simple oneliner:
inotifywait --format="%w%f" -rm /var/log/apache2/ | gawk '{ print }'
This is exactly my start. But if I pipe that output further, I get no output:
inotifywait --format="%w%f" -rm /var/log/apache2/ | gawk '{ print }' | wc -l
Anyway, if I use 'ls', 'tail' (what I really want), there is never output (in another console, running the first statement, I know, there are changes). I tried with adding stdbuf, fflush(), nothing works. I dont understand the problem! I want to keep this onliner into a script, which I can use as a string point. Otherwise, I could (but dont wish to) use xargs. Any help or tips would be fine!