I am trying to grep
the ongoing tail
of file log and get the n
th word from a line. Example file:
$ cat > test.txt <<EOL
Beam goes blah
John goes hey
Beam goes what?
John goes forget it
Beam goes okay
Beam goes bye
EOL
^C
Now if I do a tail
:
$ tail -f test.txt
Beam goes blah
John goes hey
Beam goes what?
John goes forget it
Beam goes okay
Beam goes bye
^C
If I grep
that tail
:
$ tail -f test.txt | grep Beam
Beam goes blah
Beam goes what?
Beam goes okay
Beam goes bye
^C
But if I awk
that grep
:
$ tail -f test.txt | grep Beam | awk '{print $3}'
Nothing no matter how long I wait. I suspect it's something to do with the way the stream works.
Anyone have any clue?