From: Wybo Dekker Date: 2005-12-31T21:17:49+09:00 Subject: Re: Beginners Question On Sat, 31 Dec 2005, Daniel Schierbeck wrote: > joe quimby wrote: > Hello Folks, > > I am trying to learn ruby, so i wrote some simple scripts. > But the following script does not work as expected: > > #!/usr/bin/ruby > > while gets != nil > print $_ > end you could also have said: #!/usr/bin/ruby print while gets > if i call 'echo.rb' (without any parameters) from my cygwin shell, the > scripts does what i expect it to do. It reads and returns the input. > But if i call it with any parameters, like > > echo.rb anything > > i get a error message saying : '... `gets': No such file or directory - > 12 (Errno::ENOENT)...' > > Does anybody understand this ? apparently you typed: echo.rb 12 If there are arguments, ruby interprets those as the names of files to be used (after concatenation) as standard input. But there was no file '12' -- Wybo