Re: [Off Topic] Directory Listing to HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2007-09-18 at 12:13 -0400, James Kosin wrote:
> Anyone have a good script to generate an HTML file for a directory
> listing?

If you're using Apache, it can do that all by itself.  You can even
customise what it does above and below the listing.

The following very simple BASH script generates a file with a listing of
the current directory, vaguely similar to how Apache generates one.

echo "<html><head><title>testing</title></head><body><h1>testing</h1>"
for file in *
do
   echo "<div><a href=\"$file\">$file</a></div>"
done
echo "</body></html>"

You could do something like that, but you'd probably want to expand on
it.

-- 
[tim@bigblack ~]$ uname -ipr
2.6.22.4-65.fc7 i686 i386

Using FC 4, 5, 6 & 7, plus CentOS 5.  Today, it's FC7.

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux