From: Michal Suchanek Date: 2006-01-06T20:59:23+09:00 Subject: Re: How do you sort a text file? On 1/6/06, Robert Klemme wrote:> Danny Abc wrote:> > I'm new to Ruby and was wondering how to sort a text file?> >> > With UNIX scripts, I just use "cat input.txt | sort > output.txt".>> You are entitled to the "useless cat award". :-) Any reason why you don't> just do> "sort input.txt > output.txt"? Well, cat does not write its arguments so you are pretty sure it isthe input argument whatever command you put next in the pipeline.Plus there was a shell once where input redirection did not work andone replaced it with cat and |. At least that is how I learned to useuseless cats extensively.Anyway, cats are nice :) Thanks Michal -- Support the freedom of music!Maybe it's a weird genre .. but weird is *not* illegal.Maybe next time they will send a special forces commandoto your picnic .. because they think you are weird. www.music-versus-guns.org http://en.policejnistat.cz