#!/usr/bin/env ruby # coding: euc-jp pattern = Regexp.new(ARGV.shift) # 第1引数はパターン print ARGF.readlines.grep(pattern)