#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
imagelocation="http://www.stallinga.org/AcadActiv/Images/"
dirr=${PWD};
while [[ $dirr == */stallinga* ]]; do
dirr=${dirr#?}
done
echo "Contents of: ${dirr}/
" > index.html
echo "
" >> index.html else if [[ "${f}" = *.pdf ]]; then echo " | " >> index.html else if [[ "${f}" = *.html ]]; then echo " | " >> index.html else if [[ "${f}" = *.png ]]; then echo " | " >> index.html else if [[ "${f}" = *.gif ]]; then echo " | " >> index.html else if [[ "${f}" = *.zip ]]; then echo " | " >> index.html else echo " | " >> index.html fi fi fi fi fi fi if [ "${f}" = "index.html" ]; then echo " | index.html (this file) | N/A | " >> index.html else if [ -d "${f}" ] ; then # directory echo "${f} | " >> index.html else echo " | ${f} | " >> index.html FILESIZE=$(stat -c%s "${f}") echo "($FILESIZE bytes) | " >> index.html fi fi echo "
PjotrSoft psindex auto-generated-directory-listing script. Generated: " >> index.html date +"%d/%b/%Y" >> index.html echo "" >> index.html IFS=$SAVEIFS