A simple search engine written in perl ! #!/bin/sh echo "Content-type: text/html" echo echo '<html> <head> <title> Results </title> </head> <body>' argument=`echo "$QUERY_STRING" | sed "s|q=||"` cd /<your web server root directory> echo '<pre>' grep -i "$argument" *html */*html | sed -e 's|<|\<|g' -e 's|>|\>|g' echo '</pre>' Now all you do is run this under your web server root directory with appropriate permissions. viola ! with the power of the shell and perl you could do magic.
Advertisement

0 Responses to “Search engine in a few lines”