Friday, November 9, 2012

Piping the output of a log file into another program

to "follow" a log file, use:

tail -F <filename>

the output can be put into a fifo named pipe by doing:

mkfifo /tmp/nadafifo
tail -F access.log > /tmp/nadafifo&

Now use can do whatever you want with /tmp/nadafifo

e.g.
cat /tmp/nadafifo

No comments:

Post a Comment