#! /bin/sh # $1 is the top of the manual page tree to look through dir=$1 cd $dir for m in `find . -name '*.html'`; do origsubdir=`grep -F '||' -e 's| ||g'` subdir=`grep -F '||' -e 's| ||g'` # If no subdir information is present, this is not a rendered manpage, # but something else, like index.html if [ "$origsubdir$subdir" = "" ]; then continue fi manfile=`echo $m | sed -e 's|\./||'` origmanfile=`echo $manfile | sed -e "s|^$subdir|$origsubdir|"` case ${origsubdir}:${subdir} in apps:man1 | crypto:man3 | ssl:man3 ) ;; * ) echo Redirect permanent /$dir/$origmanfile /$dir/$manfile ;; esac done cat <