#!/bin/bash #Copyright 2001, William Stearns #GPL'd. #Version 0.2 if [ "$1" = "fullpage" ]; then cat < `pwd | sed -e 's@.*/@@'` file listing EOHEADER fi if [ -f htmlfilelist-header.html ]; then cat htmlfilelist-header.html echo \ fi echo \ echo \\ \\\ Up one level\\\ \\\\\\ \\\ \\\ \ #FIXME doesn't handle files with spaces correctly; -e 's/^/"/' -e 's/$/"/' gives too many quotes to ls and -e 's/ /\\ /g' fails. for OneObj in `find | sed -e 's@\./@@' | grep -v '^\.$' | sort` ; do ObjName=`echo "$OneObj" | sed -e 's@.*/@@'` if echo "$OneObj" | grep -q '/' ; then ObjPath=`echo "$OneObj" | sed -e 's@\(.*\)/.*@\1@'` else ObjPath="." fi #echo X${ObjPath}X${ObjName}X >/dev/stderr if [ -d $OneObj ]; then echo \\ \\\ $OneObj\\\ \\\\\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ #FIXME - do a case on *filelist.html, index. elif [ "$ObjName" = "htmlfilelist-header.html" ]; then : elif [ "$ObjName" = "htmlfilelist-footer.html" ]; then : elif [ "$ObjName" = "filelist.html" ]; then #Leave off size, date and timestamp for the currently-being-modified filelist.html echo \\ \\\ $OneObj\\\ \\\ \\\ \\\ \ elif [ "$ObjName" = "index.html" ] && [ $OneObj -ef $ObjPath/filelist.html ]; then #Same as above (only used if the exact same inode as filelist.html). echo \\ \\\ $OneObj\\\ \\\ \\\ \\\ \ else #Normal file echo \\ \\\ $OneObj\\\ \ `ls -ald "$OneObj" | awk '{print $5}'`\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ fi done echo \ if [ -f htmlfilelist-footer.html ]; then echo \ cat htmlfilelist-footer.html fi if [ "$1" = "fullpage" ]; then cat < Generated `date` by htmlfilelist EOFOOTER fi #FIXME - add icons too? # address-book.html 326 bytes Tue Mar 25 10:47:58 1997 Hypertext Markup Language # archive/ 4 Kb Tue Sep 30 23:31:05 1997 Directory # bookmark.htm 402 Kb Tue Jan 21 10:51:46 1997 Hypertext Markup Language # bookmarks.html 494 Kb Tue Oct 9 12:12:49 2001 Hypertext Markup Language # cache/ 4 Kb Fri Oct 5 17:29:19 2001 Directory # cert5.db 32 Kb Tue Sep 30 23:01:31 1997 # cert7.db 376 Kb Tue Apr 17 16:07:27 2001 # cookies 1 Kb Tue Oct 9 08:46:52 2001