From: ARIMA Yasuhiro Date: 2000-03-23T23:55:58+09:00 Subject: [ruby-talk:02105] Re: ARGF or $< Hi. Hugh Sasse Staff Elec Eng wrote | Has anyone any examples of how to use ARGF or $< as I cannot find much | in the docs? Thank you, Have you read next page ? I can find them. http://www.ruby-lang.org/en/man-1.4/variable.html#lt http://www.ruby-lang.org/en/man-1.4/variable.html#argf ## In fact, I read in japanese. ## http://www.ruby-lang.org/ja/* ## http://www.ruby-lang.org/ja/yasugi.pdf # # cat.rb # # ruby cat.rb file(s) # for line in ARGF print line end # # grep.rb # # ruby grep.rb re file(s) # re = Regexp.compile(ARGV.shift) for line in ARGF print line if re =~ line end -- ARIMA Yasuhiro