#!/bin/sh
#script name golook
#purpose: interactive interface for the find command. (not real usefull)
# Hear's what's going on.
#1. clears the screen.
#2. prompts for file to log to.
#3. read the ANS.
#4. case $ANS is y or Y then T is true any other answer do nothing.
#5. if $T is true then prompt for name of log file.
#6. read LOGFILE
#7. prompts for file to search for.
#8. read FILENAME
#9. prompts for directory to start the search from.
#10. reads DIR.
#11. if $T is true, run the find command on the file name given starting at
# the give directory and tee the output to the given file name.
#12. else run the find command on the given file and directory and just output
# to screen.
clear
echo ""
echo ""
echo "Do you want the output of the find command go be logged to a file?(y/n)\c>>"
read ANS
case $ANS in
[Y,y]) T=true;;
* );;
esac
echo ""
echo ""
if test $T ;then
echo "Enter file or full path of file. \c>"
read LOGNAME
echo ""
echo ""
fi
echo "Enter the name of the file you wish to search for. \c >>"
read FILENAME
echo ""
echo ""
echo "Enter the direcrtory path you would like to search from. \c >>"
read DIR
if test $T ;then
find $DIR -name $FILENAME -print |tee $LOGNAME
else
find $DIR -name $FILENAME -print
fi