From: Christian Neukirchen Date: 2005-10-06T05:39:25+09:00 Subject: Re: One-liner removing duplicate lines Damien Wyart writes: > Hello, > > Converting from Perl to Ruby, I am trying to find an equivalent to this > Perl one-liner removing duplicate lines in a file (without sorting it at > first) : > > perl -ne'$s{$_}++||print' infile >outfile ruby -ne 'BEGIN{$s={}};$s[$_] ||= !puts($_)' Not exactly nice, though. > Many thanks in advance, > Damien Wyart -- Christian Neukirchen http://chneukirchen.org