[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02105] Re: ARGF or $<

From: ARIMA Yasuhiro <fit0298@...>
Date: 2000-03-23 14:55:58 UTC
List: ruby-talk #2105
Hi.

Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> 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 <fit0298@fitec.co.jp>

In This Thread