|
From: | Bob Proulx |
Subject: | bug#10287: [wishlist] uniq can remove non adjacent lines |
Date: | Tue, 13 Dec 2011 11:09:55 -0700 |
User-agent: | Mutt/1.5.21 (2010-09-15) |
Davide Brini wrote: > Bob Proulx wrote: > > perl -lne 'print $_ if ! defined $a{$_}; $a{$_}=$_;' > > While we're at it, this is the typical awk way to do that: > > awk '!a[$0]++' I like it! I will definitely be using that awk idiom in the future. It is simple and concise. Bob
[Prev in Thread] | Current Thread | [Next in Thread] |