From: luisbebop Date: 2008-10-27T10:55:36+09:00 Subject: Re: Join all text files in a folder, with a single line of Ruby code > ruby -pe'1' * Can you explain ? Sorry, but I didn't understand. Thanks :) On Oct 26, 4:48 pm, Joel VanderWerf wrote: > Nobuyoshi Nakada wrote: > > Hi, > > > At Sun, 26 Oct 2008 04:08:48 +0900, > > Joel VanderWerf wrote in [ruby-talk:318574]: > >>> ruby -e"puts ARGF.to_a" *.txt >merged > >> Cheating a bit: > > >> ARGV.replace Dir['*']; print ARGF.read > > >> Not recommended, though, since it reads all the data into memory and > >> steps on ARGV. > > > ruby -pe 'BEGIN{ARGV.replace Dir["*"]}' > > Very nice! But if you are going that far, why not go all the way: > > ruby -pe'1' * > > -- >        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407