HTML Index File Generation

Generate index file(.html) with links to *.html files in a directory.

1
2
3
4
5
6
7
8
9
10
11
12
13
html_index () {
echo "" > index.html

local o=$IFS
IFS=$(echo -en "\n\b")

for file in `ls *.html`
do
echo "<a href='$file' target='_blank'>`basename $file .html`</a><br />" >> index.html
done

IFS=o
}