---Reply to mail from Michael A. Lees about How to Pluck a folder?

>   I  have a folder with several files (mainly TXT), but not related to
>   each  other,  and  with  no  index.  I frequently update this folder
>   (add/remove  files), and having to create/change an HTML index every
>   time is a bit cumbersome.
> 
>   My question is: how can I Pluck this folder? I.e., I want to be able
>   to  select the folder to be Plucked, and in Plucker have a list with
>   links  to  the  files  of  that  folder. Something like you see when
>   accessing an FTP folder through a browser: you type the FTP address,
>   and get a list of files with hyperlinks to them.

Something like this:
#! /bin/bash

# Create home.html file in a directory for plucker CRH

if [ $# -eq 1 ];then
    DIR=$1
else
    DIR=.
fi

cd "$DIR"

cat >home.html <<EOM
<HTML>
<HEAD><TITLE>Pictures</TITLE></HEAD>
<BODY>
<P>Tap the Picture for a larger view.</P>
<P>
EOM

for file in *
do
    if [ "$file" != "home.html" ]; then
        name=`basename $file`
        echo "<li><a href=\"$file\">$file</a>" >>home.html
    fi
done

echo "</BODY></HTML>" >>home.html


    Set it to be your 'beforepluck' command (if the parser supports it)
and you're all set.

---End reply

Christopher R. Hawks
HAWKSoft
-------------------------------------------------------------------------
Any research done on how to efficiently use computers has been long lost
in the mad rush to upgrade systems to do things that aren't needed by
people who don't understand what they are really supposed to do with them.
    -- Graham Reed, in a.s.r.





_______________________________________________
plucker-list mailing list
[email protected]
http://lists.rubberchicken.org/mailman/listinfo/plucker-list

Reply via email to