#!/bin/bash echo '
' > index.html for n in * do # check to see if it's a file, and not this file # use quotes around $n in case filename has spaces if [ -f "$n" ] && [ "$n" != "indexer" ] && [ "$n" != "index.html" ] then # need weird quoting for href and for possible spaces echo ''"$n"'' >> index.html fi done echo '' >> index.html # end indexer