From: "Randy W. Sims" Date: 2003-12-19T14:32:52+09:00 Subject: Re: question about I/O and pipes 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-----