[Mailman-Users] archive search engine?

John van V apps_adm at puny.vm.com
Thu Aug 10 21:01:27 CEST 2000


I'm using this shell cgi to search perl plain ole docs,

I grep thru text files and then href to html versions.

Since mail is ~supposed~ to be text, you can even eliminate one step.

The key to searching different directories is the find statement, not used here.

Great intra-net-warz...

But, the `eval` section has most people thinking I'm crazy, so please check the perl meta-eliminator...
and email me if you can crack it ;)

#!/bin/bash

echo Content-type: text/html
echo

echo "<html>"
echo "<body background=/images/cuniform.gif>"
echo "<tmpl_include \"/puny.css\">" ;
echo "<LINK rel=\"stylesheet\" href=\"http://puny.vm.com/puny.css\"> ";

cd /usr/lib/perl5/5.00503/pod

QUERY_STRING=`echo $QUERY_STRING | perl -ne 's/(\;|exec|\\\|\\\`|\>|\!|\\||\&|\(|\)|\\\$|\{|\[)//g; print '`

eval $QUERY_STRING

echo "
<TABLE border=5 ><TD>
<h3>Search:</h3>
<form method=get name=GREP action=http://puny.vm.com/cgi-bin/pod_grep.cgi>
   <input type=text value=$GREP size=32 name=GREP maxlength=128 text=$GREP>
</form>
</TD></TABLE>
<BR>
"
#echo "<HR><H2>$GREP<H2><HR>"

echo $QUERY

files=`grep -l $GREP *`

for i in $files
do
href=`echo $i | perl -ne 's/\.pod//;print'` 
echo "<table width=80% align=center border=3 class=doctext><td class=doctext>
<a href=/pub/perl/pod/$href.html><BR><h3 class=doctext> $i </h3></a>
<h4 class=doctext>"
pod2text $i | grep -C $GREP | more
echo "</td></table><BR>"
done


for i in $x
do
echo $i
done

echo "<br>"

echo "<br>"
echo "<br>"
echo "</body>"  
echo "</html>"




More information about the Mailman-Users mailing list