Create a file toHTML.sh (for example) with this content:
Code:
#!/bin/bash
# $1: first parameter is the directory, the content of which
# is to be displayed (current directory if not given).
# $2: second parameter is the output file (directory.html for
# example). If none giver, result is put to standard out.
if [ -n "$2" ]; then
exec 1>"$2" || exit 1
else
exec 2>/dev/null
fi
cd "${1:-.}" || exit 1
cat <<-THEEND
<html><head>
<title>Content of: ${1:-.}</title>
</head><body>
<ul style="font-family: monospace;">
THEEND
/bin/ls -liaF | grep -v "^total" | sed 's/^\(.*\)$/ <li>\1</li>/'
cat <<-THEEND
</ul>
</body></html>
THEEND
Use it like that to have the content of /usr/share/icons stored in a file called icons.html in your home directory:
$ toHTML.sh /usr/share/icons $HOME/icons.html
Yves.