[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: |
Pádraig Brady |
Subject: |
Re: Piping tail -f to fold: tail -f log.txt | fold |
Date: |
Fri, 9 Jan 2009 20:19:55 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Bob Proulx wrote:
> 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
>
> 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.
Well tail -f flushes stdout so it's not actually the problem in this case.
I think this may be due to the i18n changes applied by your distro.
You can disable this logic using the LC_ALL environment variable.
Can you see if this works around the problem for you:
tail -f log.txt | LC_ALL=C fold -s
cheers,
Pádraig.