An old Bash script that uses awk to construct an index with hyperlinks from the .html files in a web tree. Attempts to use the <title> tag to name each link.
To use, change your directories in the 'for dir' line to the directories you want to scan, then run the script: ./myscript.sh > myfile.html.
#!/bin/bash for dir in html img inc home; do echo echo "" newstring=$dir firstchar=${newstring:0:1} string1=${newstring:1} dirname=`echo $firstchar | tr '[a-z]' '[A-Z]'` echo "" echo "" done$dirname$string1
" echo "" for file in `find $dir -name \*.html -print`; do #echo $file title=`awk 'BEGIN{IGNORECASE=1;FS="
" echo "| ";RS=EOF} {print $2}' $file` if [ -z "$title" ]; then title="NO TITLE! - $file" fi echo "- $title
" done echo "
Categories:
I participate in the Amazon Associates program. Making your Amazon purchases through my affiliate links supports this site at no additional cost to you: