shithub: riscv

ref: c0d21d35b103e980e658fff1ef07107e72a03364
dir: /rc/bin/ape/grep/

View raw version
#!/bin/rc

rfork e

opts=()
files=()
argv0=$0
while(! ~ $#* 0){
	switch($1){
	case -[cefinsv]
		opts=($opts $1)
	case -q
		opts=($opts -s)
	case -*
		echo $argv0 $1 not supported >[2=1]
		exit 'not supported'
	case *
		files=($files $1)
	}
	shift
}
exec /$cputype/bin/grep $opts $files