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.