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

Re: [Sheflug] HTML Logs



On Fri, 2003-05-16 at 11:58, Richard Ibbotson wrote:
> Hi
> 
> 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>`
> 
> 
> 
> it bombs out with the following error message..
> 
> ./logfile: line 8: unexpected EOF while looking for matching ``'
> ./logfile: line 9: syntax error: unexpected end of file
> 
> 
> 
> 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.
> 
> Thanks
> 
> 
> 
> 
> Richard


ignoring the sed for now I don't think you should be using backticks to
quote your echo statements, these should be ' or ".

 Dave.

> ___________________________________________________________________
> 
> Sheffield Linux User's Group -
> http://www.sheflug.co.uk/mailfaq.html
> 
>   GNU the choice of a complete generation.
-- 
Dr. David Holden. (Systems Developer)

Visit: Crystallography Journals Online <http://journals.iucr.org>

Thanks in advance:-
Please avoid sending me Word or PowerPoint attachments.
See: <http://www.fsf.org/philosophy/no-word-attachments.html>

UK Privacy (R.I.P)  : http://www.stand.org.uk/commentary.php3
Public GPG key available on request.

-- 99% of politicians give the rest a bad name --
------------------------------------------------- 

___________________________________________________________________

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

  GNU the choice of a complete generation.