#! /bin/bash if [ "$1" == "" ]; then cat > /dev/stderr < Generates an html listing titled TITLE (to Std Output) of the current directory, using BASEDIR as the root directory for naming. EOF exit 1 fi BASE=$1 TITLE=$2 CURR=`pwd | egrep -o "$BASE.*$"` DIRS=`ls --color=never -dl * | grep "^d" | awk '{ print $9 }'` SFILES=`ls --color=never -dl * | grep "^-" | grep ".scm$" | awk '{ print $9 }'` OFILES=`ls --color=never -dl * | grep "^-" | grep -v ".scm$" | grep -v ".html$" | awk '{ print $9 }'` cat <<EOF <html> <head> <title>$TITLE Listing: $CURR/

$TITLE Listing

$CURR/

EOF echo " " echo " " if [ "$CURR" != "$BASE" ]; then echo " " fi for i in $DIRS; do echo " " done echo " " if [ "$SFILES" != "" ]; then echo " " echo " " for i in $SFILES; do if [ ! -f "$i.html" ]; then ~/bin/scheme/scheme2html.sh $i > $i.html fi echo " " done echo " " fi if [ "$OFILES" != "" ]; then echo " " echo " " for i in $OFILES; do echo $i | grep ".class$" &> /dev/null if [ $? == 1 ]; then echo $i | grep ".html$" &> /dev/null if [ $? == 1 ]; then echo " " fi fi done fi cat < EOF
Directories

../
$i/
Scheme Files

$iPlainHTML
Other Files

$iPlain