From: Chad Perrin Date: 2006-01-08T08:58:57+09:00 Subject: Re: How do you sort a text file? On Sat, Jan 07, 2006 at 11:23:00PM +0900, Andreas Eder wrote: > >>>>> "Danny" == Danny Abc writes: > > Danny> I'm new to Ruby and was wondering how to sort a text file? > Danny> With UNIX scripts, I just use "cat input.txt | sort > output.txt". > > Why not sort output.txt? > That cat is totally superfluous. You don't need that input redirect. Input takes a filename as an argument, so you can simply do this: sort input.txt > output.txt -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] "Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts." - Paul Graham