On 1/6/06, Robert Klemme <bob.news / gmx.net> 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