NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: uniq on open streams
On Tue, 23 Apr 2019 11:50:23 +0000, Greg A. Woods wrote:
...
>
> Thinking "Oh, so it should work on FreeBSD too...", I opened a window to
> my recently installed FreeBSD-12.0 machine, and after rewriting the Lua
> code into AWK, I was surprised to see absolutely no output at all!
stdout buffering is a thing. awk may not flush stdout, esp. when
stdout is not a terminal. So uniq may not get anything.
(echo a; echo b; echo c; sleep 3) | uniq -c
is test case enough, and doesn't have the stdout buffer issue.
- Andreas
--
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
Home |
Main Index |
Thread Index |
Old Index