Skip to Content.
Sympa Menu

baslinux - Re: [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: Re: [BL] I love links2 and httpd
  • Date: Mon, 9 Mar 2009 17:54:14 -0300

Hi Steven,
Sorry about this simple question but, how can I run tis script ?
I put a (txt) file called list_dir.sh with your script and did the chmod 777 for this file but, when I execute the terminal show a error message:
4: Syntax error "word unexpected (expecting "do")"

Thank you,

Marcelo Campos
marcelo AT smartradio.com.br

----- Original Message ----- From: baslinux AT lists.ibiblio.org
To: baslinux AT lists.ibiblio.org
Sent: Monday, March 09, 2009 4:16 PM
Subject: [BL] I love links2 and httpd


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

-----------------------
BasicLinux mailing list
-----------------------
http://www.basiclinux.com.ru
http://www.ibiblio.org/pub/linux/distributions/baslinux/
------------------------------------
To exit, send subject=unsubscribe to
baslinux-request AT lists.ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page