#!/bin/rc
rfork e
usage='usage: kfind -t database pattern
db is sys, rfc
example:
kfind2 -t rfc esmtp |p
kfind2 -t sys ''exe*n'' |p
kfind2 -t sys ''exe*n&fork'' |p
kfind2 -t sys ''exe*n|fork'' |p
kfind2 -t sys -t rfc ''subm*&smtp'' |p
# Two types of wild card, "*" and "?", are allowed.
# In using wild card, they must follow after two or more letters.
'

if(~ $#* 0){
	echo $usage
	echo 'you may use databases listed below:'
	k=/n/other/kirara2
	for(f in $k/*db) {
		echo $f | sed 's!^'$k'/([a-zA-Z0-9]*)db!\1!'
	}
	exit
}
exec kfind2 $*
