[BL] I love links2 and httpd
baslinux at lists.ibiblio.org
baslinux at lists.ibiblio.org
Mon Mar 9 16:54:14 EDT 2009
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
More information about the BasLinux
mailing list