#!/bin/sh
(
echo "
"
find /usr/share/doc -name 'index.html' | \
sed 's/index.html$//' | \
sort | \
awk '{
if (0 == index($1,OLD_PREFIX) || OLD_PREFIX=="") {
print $0
OLD_PREFIX=$1
}
}' | \
sed 's/$/index.html/
s/^\(.*\)$/- \1<\/a><\/li>/'
echo "
"
) > ~/doc_index.html