Re: uniq without sort <-------------- GURU NEEDED

gnuist006 [at] gmail.com wrote:

> I want uniq without sorting the initial order.

echo -e "a\nc\nd\nb\nc\nd" | perl -nle 'print unless $seen{$_}++'

outputs

a
c
d
b

Peter

--
~/.signature: No such file or directory
pjacklam [ Fr, 25 Januar 2008 17:22 ] [ ID #1915922 ]
Linux » comp.unix.shell » Re: uniq without sort <-------------- GURU NEEDED

Vorheriges Thema: Bash script to subtotal a column in a file
Nächstes Thema: Re: uniq without sort <-------------- GURU NEEDED