From: Sean O'Halpin Date: 2005-10-06T21:59:27+09:00 Subject: Re: One-liner removing duplicate lines On 10/6/05, Robert Klemme wrote: > (David, I'm sorry again this is no #inject solution.) I couldn't resist :) ruby -e "ARGF.inject({}) {|h, x| h.key?(x) or h[x] = puts(x); h}" To handle missing newline at EOF: ARGF.inject({}) {|h, x| h.key?(x.chomp) or h[x.chomp] = puts(x); h} Regards, Sean