#!/bin/sh 
echo Content-TYPE:  text/html 
echo 
  
if [ $# = 0 ]           # is the number of arguments == 0 ? 
then                    # do this part if there are NO arguments  
 echo "<HEAD>" 
 echo "<TITLE>Local Phonebook Search</TITLE>" 
 echo "<ISINDEX>"
 echo "</HEAD>" 
 echo "<BODY>"
 echo "<H1>Local Phonebook Search</H1>" 
 echo "Enter your search in the search field.<P>"
 echo "This is a case-insensitive substring search: thus" 
 echo "searching for 'ian' will find 'Ian' and Adriana'." 
 echo "</BODY>" 
else                     # this part if there ARE arguments 
 echo "<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>" 
fi 

