View Single Post
Old 08-13-2010, 10:44 PM   #4
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 519
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
This shell script will do that, supposing you have a sufficiently modern shell (like bash). Even on Windows you can get bash.

Code:
#! /bin/sh
# Make an HTML file pointing to all epub files in the current directory

cat > list.html <<EOF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4.01 Strict//EN"  
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
<title>My Ebooks</title>
</head>
<body>
<h1>My Ebooks</h1>
EOF

for book in *.epub
do echo "<p><a href=\"$book\">${book%.epub}</a></p>" >> list.html
done

cat >> list.html <<EOF
</body>
</html>
EOF
pietvo is offline   Reply With Quote