Hi,
I am mohan. I wish to share a script that will create an entire directory links in a HTML page. here is the script..
#! /bin/sh
# webtree.bash - directory structure listing in HTML
# creating HTML tags
echo "<html>
<head><title>$1/`basename $1`.html</title>
</head>
<body bgcolor='orange'>" > $1/`basename $1`.html
# creating links to the files in directory tree
for i in `find $1`
do
if test -d $i
then
echo "<br><br>$i<br>" >> $1/`basename $1`.html
else
echo "<br><a href='$i'>$i</a>" >> $1/`basename $1`.html
fi
done
# creating end tags for HTML
echo "</body>
</html>" >> $1/`basename $1`.html
echo $1/`basename $1`.html completed
sed -e "s:<a href='$1/:<a href=':g" $1/`basename $1`.html > tmp.html
rm $1/`basename $1`.html
mv tmp.html $1/`basename $1`.html
unset i
#run as
# $webtree.bash directory
This is my first script. Hope this script will be useful to someone. Forgive gurus if I made any mistakes in this script and correct me. my mail is mohan34u@freeshells.ch.
Thank you.
Always,
Mohan R