xref: /plan9/rc/bin/ape/grep (revision 2a7824990d644563b93ed8d4abf1407c40b2087a)
1#!/bin/rc
2
3rfork e
4
5opts=()
6files=()
7argv0=$0
8while(! ~ $#* 0){
9	switch($1){
10	case -e
11		opts=($opts $1 $2)
12		shift
13	case -[cfinsv]
14		opts=($opts $1)
15	case -q
16		opts=($opts -s)
17	case -*
18		echo $argv0 $1 not supported >[2=1]
19		exit 'not supported'
20	case *
21		files=($files $1)
22	}
23	shift
24}
25exec /$cputype/bin/grep $opts $files
26