#!/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 echo "" >> index.html #for f in $(find -type f -iname '*') for f in $(find *) do echo "file: ${f}" if [[ "${f}" == */* ]]; then echo "contains /" else echo "" >> index.html if [ -d "${f}" ] ; then # directory 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 else if [ -d "${f}" ] ; then # directory echo "" >> index.html else echo "" >> index.html FILESIZE=$(stat -c%s "${f}") echo "" >> index.html fi fi echo "" >> index.html fi done echo "
index.html (this file)N/A${f}${f}($FILESIZE bytes)
" >> index.html echo "
" >> index.html echo "

PjotrSoft psindex auto-generated-directory-listing script. Generated: " >> index.html date +"%d/%b/%Y" >> index.html echo "" >> index.html IFS=$SAVEIFS