0

I'm trying to follow a log file and want to extract a field from it. I've tried

tail foo.txt | cut -f 5

and this works, but if I try to follow changes via

tail -f foo.txt | cut -f 5

nothing is printed, even when there are changes to the file.

Any suggestions or comments about why this is happening?

1 Answer 1

1

BASH FAQ entry #9: "What is buffering? Or, why does my command line produce no output: tail -f logfile | grep 'foo bar' | awk ..."

2
  • Is there a way to force unbuffering with cut? Incidentally, I switched to using awk, and the buffering problem went away.
    – jonderry
    Apr 22, 2011 at 0:34
  • unbuffer will force unbuffering in almost any program. Apr 22, 2011 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .