[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Piping tail -f to fold: tail -f log.txt | fold
From: |
Bob Proulx |
Subject: |
Re: Piping tail -f to fold: tail -f log.txt | fold |
Date: |
Fri, 9 Jan 2009 10:54:49 -0700 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Philip Durbin wrote:
> To word wrap the output of a growing log file I tried. . .
> $ tail -f log.txt | fold -s
> . . . and it works fine on NetBSD and Mac OS X, but on the two Linux
> distributions I tried (Red Hat and SUSE) I get no output.
This topic comes up periodically. Please see this reference for a
recent more thorough discussion:
http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00134.html
> If not, can anyone please explain the difference in the implementation
> of fold?
In summary it is all about I/O buffering happening in libc's output
routines. If the output is not a tty then data is buffered for
performance reasons into larger chunks before writing.
> Can piping tail -f to fold be made to work on Linux the way it works on BSD?
There are various methods posted in the other thread. I will leave
you to browse them.
Bob