openmamba-website/wwwroot/cgi-bin/text-to-html-filter.cgi

19 lines
751 B
Plaintext
Raw Permalink Normal View History

2011-04-29 19:11:08 +02:00
#!/bin/bash
echo $header
ext=${file/*.}
range=10000
filename="/var/www/www.openmamba.org/$file"
[ "$page" -a $page -gt 0 ] || page=1
from=`expr \( $page - 1 \) \* $range + 1`
to=`expr $from \+ $range - 1`
if [ "$ext" = "log" -o "$ext" = "spec" -o "$ext" = "patch" -o "$ext" = "diff" ]; then
/bin/sed -n "${from},${to}p" $filename | /bin/sed -e 's|\&|\&|g' \
-e 's|<|\&lt;|g' \
-e 's|>|\&gt;|g' \
-e 's|\([[:alpha:][:digit:]]*\)\@[[:alpha:][:digit:]]*\.[[:alpha:][:digit:]\.]*|\1@...|g'
#'s|\&|\\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|g' -e 's|\([[:alpha:][:digit:]]*\)\@[[:alpha:][:digit:]]*\.[[:alpha:][:digit:]\.]*|\1@...|g' /var/www/www.openmamba.org/$file
else
/bin/sed -n "${from},${to}p" $filename
fi
exit 0