----Next_Part(Sun_Feb_22_01:03:21_1998_246)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

ふなばです。

第二弾、とても遅い  wc です。 オプションは受けつけませんが、UNIX の wc
と同じようなもんでしょう。

--Tadayoshi Funaba


----Next_Part(Sun_Feb_22_01:03:21_1998_246)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

#! /usr/local/bin/ruby

def wc(text, file  il)
  lc  ext.scan(/\n/o).length; $lc + c
  wc  ext.scan(/\S+/o).length; $wc + c
  cc  ext.length; $cc + c
  printf('%7d %7d %7d', lc, wc, cc)
  printf(' %s', file) if file
  puts ''
end

$es  lc  wc  cc  
if $*.empty? then
  wc($stdin.read || '')
else
  for file in $*
    begin
      input  ile.open(file)
      wc(input.read || '', file)
      input.close
    rescue
      $stderr.puts "#{$0}: #{file}: cannot read"
      $es  
    end
  end
end
printf("%7d %7d %7d total\n", $lc, $wc, $cc) if $*.length > 
exit $es

----Next_Part(Sun_Feb_22_01:03:21_1998_246)----