From: Joel VanderWerf Date: 2005-07-29T01:25:52+09:00 Subject: Re: Sed -> Ruby : .. and ... Keith Fahlgren wrote: > sed: > s/MATCH/GLOBAL REPLACEMENT/g > > ruby: $ cat test foo bar 123 $ ruby -p -e 'gsub(/bar/, "BAR")' test foo BAR 123 Also, you can use the ARGF constant to access all of the input files (or stdin if there are none) as a single IO. ARGF.each do |line| ... end