#!/bin/ksh if [ -z "$1" -o -n "$3" ] then echo "hotshell: illegal option or usage" echo "Usage: hrgrep (pattern) [directory]" echo "If no directory given, searches current directory" exit 1 elif [ -n "$1" -a -z "$2" ] then find . -exec grep $1 {} \; exit 0 elif [ -n "$1" -a ! -d "$2" ] then echo $2" is not a valid directory" exit 1 elif [ -n "$1" -a -d "$2" ] then find $2 -exec grep $1 {} \; exit 0 fi