From: "Peña, Botp" Date: 2008-10-27T14:13:30+09:00 Subject: Re: Join all text files in a folder, with a single line of Ruby code From: Joel VanderWerf [mailto:vjoel@path.berkeley.edu] # luisbebop wrote: # >> ruby -pe'1' * # > # > Can you explain ? Sorry, but I didn't understand. # If you run this in a shell, the * expands to all files. # The -p switch means "for each line in the files on the # command line, store the line into $_, and print $_. # Usually, you want to use -e'some code' to operate # on $_. In this case, the '1' is a no-op, so it just # prints the line without changing it. HTH. wc also means, ruby -pe '' *