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

[Sheflug] Re: HTML Logs



Hi

Okay, I've had a look at everyone's suggestions and this is what I have
now...

#!/bin/sh

echo Content-type: text/html
echo
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]<td>*[ 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>'


If I include the " quotation mark in the last line I get...

<h1>Log files in /var/log</h1><p>
<table border=1> <tr><th>Name<th>date<th>size<tr>
./logfile: line 11: unexpected EOF while looking for matching `"'
./logfile: line 12: syntax error: unexpected end of file


So, I've removed it.  What I get now in the way of an error message
is....

<h1>Log files in /var/log</h1><p>
<table border=1> <tr><th>Name<th>date<th>size<tr>
sed: -e expression #1, char 48: Unterminated `s' command


I think this means that the sed part of it is very wrong ?

Thanks




Richard
___________________________________________________________________

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

  GNU the choice of a complete generation.