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

Re: [Sheflug] HTML Logs



On Fri, May 16, 2003 at 11:58:12AM +0100, Richard Ibbotson wrote:
> Can any of our Perl or scripting people out there explain what's wrong
> with this script ?
> 
> 
> #!/bin/sh
> 
> echo `<h1>Log files in /var/log</h1><p>`
> echo `<table border=1> <tr><th>Name<th>date<th>size<tr>
> ls -ld /var/log/* |  \
> sed -e "s/^[-rwxds]*[ 0-9]* \([a-z0-9A-Z]* *\)\{2\} \([0-9]*\)
> \([A-Za-z]\{3\} *[0-9]\{1,2\} *[0-9:]*\)\/\4\5>\5<\/a><td>\3<td
> align=RIGHT>
> \2<tr>/"echo `</table>`

You don't want the ` in the echo statements, and the second line is missing
the last one anyway.

> What I'm trying to do it turn my logs in /var/log into HTML pages so
> that I can view them in a web browser.

You'll need more HTML and CGI than that. For a start, you'll need

echo Content-type: text/html
echo

.. near the top, otherwise you'll just get a 500 internal server error.

Cheers,

Alex.

___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.