#!/bin/ksh # run WN version of wndex, then add directories. PATH=/opt/sfw/bin:/usr/local/bin:/bin:/usr/bin export PATH # create initial index.cache file unless it already exists opt= test -f 'index.wn' || opt='-a' wndex $opt ${1+"$@"} # examine the options passed to wndex, and update the correct # index.cache file. # FIXME: add other wndex options to getopts. set X ${1+"$@"} shift dir=$(pwd) while getopts ad: c do case $c in a) ;; d) dir="$OPTARG" ;; \?) echo "invalid argument" ;; esac done shift `expr $OPTIND - 1` # add directories. sedscr='s/^/file=/ s/$/\&content=text\/directory; charset=us-ascii\&title=/' cd $dir gfind . -maxdepth 1 -type d -print | tail +2 | sort | cut -c3- | sed -e "$sedscr" >> index.cache # fix character set sed -e 's/charset=iso-8859-1/charset=us-ascii/' index.cache > x$$ mv x$$ index.cache exit 0