#!/bin/rc
flags=(-n)
while(~ $1 -*){
flags=($flags $1)
shift
}
switch($#*){
case 0
echo usage: $0 [-options] pattern [files]
exit usage
case 1
pattern=$1
files=`{ls *.[bcChslmy] *.py *.ms >[2]/dev/null}
case *
pattern=$1
shift
files=$*
}
grep $flags $pattern $files
|