Skip to Content.
Sympa Menu

baslinux - [BL] I love links2 and httpd

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] I love links2 and httpd
  • Date: Tue, 10 Mar 2009 08:16:28 +1300

Message from Steven
===================

> BTW, I have written a short script for httpd
> that automatically creates an index.html file
> for any directory. It provides a clickable
> link for every file in the directory. That
> means you can point your browser (via network)
> to the index file and you will get a wee menu
> of files to download or play (assuming your
> browser is configured to recognize the suffix
> and direct the file to your audio player).

Oops, I almost forgot. Here is the script:
--------------------------------------------------------
echo '<HTML>' > index.html
echo '<BODY>' >> index.html
echo '<TABLE>' >> index.html
for i in *; do
pre=`ls -dl $i | cut -c1`
case $pre in
d) pre=""
name=$i' ==>' ;;
*) pre=`ls -dsh $i |sed 's/^ *//' |cut -d" " -f1`
name=$i ;;
esac
echo '<TR>' >> index.html
echo '<TD>'$pre >> index.html
echo '<TD><A HREF="'$i'">'$name'</A><BR>' >> index.html
done
echo '</TABLE>' >> index.html
echo '</BODY>' >> index.html
echo '</HTML>' >> index.html
-------------------------------------------------------

Cheers,
Steven




Archive powered by MHonArc 2.6.24.

Top of Page