NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: uniq on open streams



it should print the line the first time it sees it and not print the
repeats, in my opinion

On Tue, Apr 23, 2019 at 11:45 AM Andreas Krey <a.krey%gmx.de@localhost> wrote:
>
> On Tue, 23 Apr 2019 05:51:19 +0000, JP wrote:
> > I had a need to run uniq on an open stream.  It doesn't seem to print
> > the most recent line.
> >
> > $ lua -e 'print("a");print("b");print("c"); repeat until false' |uniq
> > a
> > b
> >
> > ^ should print the c as well, no?
>
> Yes, but. 'uniq -c' can only print the 'c' line once it gets a different input line
> or EOF, and I'd bet that the code doesn't try to behave differently when run without -c.
>
> (Behaviour is different from GNU coreutils uniq; also:
>
>    netbsd$ uniq --help
>    uniq: uniq: No such file or directory
>
> )
>
> - 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