:
#	@(#) oasearch 25.1 92/02/24 
#
#	Copyright (C) 1987-1992 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#

OALIB=${OALIB-"/usr/lib/oa"}
PATH=$OALIB/utilbin:$PATH

 # run ourself thru oash 
eval oainit 2>/dev/null || (oash $0; kill $$)
. `findfile shell_strs`

EscWasHit() { 
	oadeinit  # no expr entered 
	exit
}

 #OASEARCH1="Text Search"
 #OASEARCH2="Search String: "
 #expr=`oainput -y5 -t"$OASEARCH1" -p"$OASEARCH2"`
 #[ "$expr" ] || exit
wmopen 1 3 60 4 10 
wmtitle "$OASEARCH1"
echo "$OASEARCH2"
wrefresh 1
read expr
[ -z "$expr" ] && EscWasHit

 #OASEARCH3="Files: "
wmopen 2 16 60 6 10
wmmessage -r "$PRESSRET"
ppfile -m  
[ -z "$PP_DIR$PP_FILE" ] && EscWasHit

 #OASEARCH4="\n    Expression not found."
TEMP=/tmp/fm1$$
trap "rm -f $TEMP" 1 2 3 15
grep "$expr" $PP_DIR$PP_FILE > $TEMP 2>&1

if test ! -s $TEMP; then echo $OASEARCH4 > $TEMP; fi

 #OASEARCH5='<< Search for ${expr} >>'
wmopen 3 18 70 5 5 
eval wmtitle \"$OASEARCH5\"
wmmessage -r "$USEARROW"
scan -e"$EOFMSG" $TEMP
rm -f $TEMP
oadeinit
