From: aastanti@... (Alfio Astanti) Date: 2003-12-24T00:06:52+09:00 Subject: Re: question about I/O and pipes "Randy W. Sims" wrote in message news:<3FE28D7C.2070505@ThePierianSpring.org>... > One more time with a little less perl. > > -----><8----- > @rem = '--*-Ruby-*-- > @echo off > if "%OS%" == "Windows_NT" goto WinNT > ruby -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 > goto endofruby > :WinNT > ruby -x -S %0 %* > if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofruby > if %errorlevel% == 9009 echo You do not have Ruby in your PATH. > if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul > goto endofruby > @rem '; > #!ruby > #line 15 > > cnt = 0 > $stdin.each_line {|line| cnt = cnt + 1 } > print cnt,"\n" > > __END__ > :endofruby > -----><8----- How is supposed to work? With ruby 1.8.0 (2003-08-04) [i386-mswin32] I got: F:\ruby\>count < count.bat ruby: No such file or directory -- count (LoadError) I get the same if I just type count (+ENTER) while double-clicking reads STDIN ... Confused AA