# grepsrc dps 12/28/98 clear NAME=grepsrc set -A PATHNAME "/bi/source/" if [ -z "$OFILE" ] then OFILE=$NAME.out fi search_ver () { cd $1 echo " " echo "Searching $PATHNAME..." echo "********************************************" >> $HOME/$OFILE echo "****** $HOST:$PATHNAME ******" >> $HOME/$OFILE echo "********************************************" >> $HOME/$OFILE echo " " >> $HOME/$OFILE for i in * do #echo $i; read yy if [[ -f $i ]] && [[ -r $i ]] && [[ $i != *".TXT" ]] && [[ $i != *".txt" ]] && [[ $i != *[0-9] ]] && [[ $i != *".out" ]] && [[ $i != *".db" ]] && [[ $i != *".df" ]] && [[ $i != *".dat" ]] && [[ $i != *".DAT" ]] && [[ $i != *".log" ]] && [[ $i != *".d" ]] then echo $i grep -is "$xx" $i -exec {} \; >> $HOME/$OFILE fi done } echo " " echo "This program will search the $HOST:$PATHNAME system for" echo "the input string. Output will be sent to the file $OFILE" echo "stored in your home directory." cd $HOME; rm -f $OFILE echo " " echo "Enter Search Criteria: \c" read xx echo "Grep for: $xx" >> $HOME/$OFILE echo " " >> $HOME/$OFILE integer j=0 while ((j < ${#PATHNAME[@]})) do search_ver "${PATHNAME[j]}" let j=j+1 done