#!/bin/sh 
echo Content-TYPE:  text/html 
echo 
04
if [ $# = 0 ]        # is the number of arguments == 0 ? 
then                 # do this part if there are NO arguments  
   echo "<html><head>" 
   echo "<title>Local Phonebook Search</title>" 
   echo "<isindex />"
   echo "</head>" 
   echo "<body>"
   echo "<h1>Local Phonebook Search</h1>" 
   echo "<p>Enter your search in the search field.</p>"
   echo "<p>This is a case-insensitive substring search: thus" 
   echo "searching for 'ian' will find 'Ian' and Adriana'.</p>" 
   echo "</body></html>" 
else                     # this part if there ARE arguments 
   echo "<html><head>" 
   echo "<title>Result of search for \"$*\".</title>" 
   echo "</head>" 
   echo "<body>" 
   echo "<h1>Result of search for \"$*\".</h1>" 
   echo "<pre>" 
   for i in $* 
   do 
        grep -i $i /vast/igraham/Personnel 
   done 
   echo "</pre>" 
   echo "</body></html>" 
fi 

