# /bin/bash
function getmp3() {
cat<<ET2
<form name="getmp3" action="./findmp3.cgi">
string in title: <input type="text" name="mp3" />
</form>
ET2
}

cat<<ET1
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD><META HTTP-EQUIV="Content-Language" Content="en-US">
<SCRIPT>
function Select() { document.getmp3.mp3.focus();}
</SCRIPT></HEAD><BODY><PRE>
ET1
if [[ -n $QUERY_STRING ]]
then
    mp3="`echo $QUERY_STRING|sed 's/.*mp3=\(.*\).*/\1/g'`"
    infile=`echo "$mp3" |sed 's# #*#g'`
    outfile=../mp3/findmp3/`echo "$mp3" |sed 's# #_#g'`.html
    echo '<link rel="stylesheet" type="text/css" href="monospace.css">' >$outfile
    find ~/public_html/mp3 -name "*$infile*mp3" -ls |sed 's#/home1/sirdavec/public_html/mp3/\(.*\)#<a href=http://sirdave.com/mp3/\1>http://sirdave.com/mp3/\1</a><br>#' >>$outfile
    cat $outfile
else
    getmp3
fi
printf "</PRE></BODY></HTML>\n"

