I'm trying to parse some info into a webpage from the logfiles. which I 'm not having too many problems with. My problem is how do I add a <BR> at the end of each line or prevent the browser from wrapping the text..
What language, please, or do you mean wrap='soft' on a textarea?
Is a bash script here it is.. don't laugh too much please... #!/bin/sh
cat /var/log/maillog | grep -G 'esmtp' > /home/httpd/html/secure/maillog.extern & cat home/httpd/html/secure/mailindex.head /home/httpd/html/secure/maillog.ext ern /home/httpd/html/secure/index.foot > /home/httpd/html/secure/sendmail.html
I know there's probably an easier way of doing it but as I said my scripting ain't upto much...
Simon
-----Original Message----- From: markj@cloaked.freeserve.co.uk [mailto:markj@cloaked.freeserve.co.uk] Sent: Friday, November 16, 2001 04:22 To: Simon Parkes Cc: ALUG Subject: Re: [Alug] How do I...
I'm trying to parse some info into a webpage from the logfiles. which I 'm not having too many problems with. My problem is how do I add a <BR> at the end of each line or prevent the browser from wrapping the text..
What language, please, or do you mean wrap='soft' on a textarea? -- MJR
On Fri, Nov 16, 2001 at 04:35:28PM -0000, Simon Parkes wrote:
Is a bash script here it is.. don't laugh too much please... #!/bin/sh
cat /var/log/maillog | grep -G 'esmtp' > /home/httpd/html/secure/maillog.extern & cat home/httpd/html/secure/mailindex.head /home/httpd/html/secure/maillog.ext ern /home/httpd/html/secure/index.foot > /home/httpd/html/secure/sendmail.html
I know there's probably an easier way of doing it but as I said my scripting ain't upto much...
You could always add a:
perl -pi -e 's/\n/<br>/' maillog.extern
in the middle - which will replace all eols with <br>s
chris.
On Fri, 16 Nov 2001, Chris Allen wrote:
perl -pi -e 's/\n/<br>/' maillog.extern
To avoid loading Perl, use this instead: cat maillog.extern | sed 's/$/<br>/' > maillog.extern
Obviously this can be embedded between other commands to make it rather more elegant. If you're curious, it's just a search/replace, adding <br> at $ (end of line).
Just for fun I'm going to fork the thread and ask how to print the fourth field of aligned text such as 'unzip -l' produces with awk. Or cut, if that's possible.
Alexis -- "The observer IS the observed! There is NO DIVISION between the CONTENT of consciousness and CONSCIOUSNESS ITSELF!" - Peekaboo, 'Rose is Rose' Attention. "Only that in you which is me hears what I am saying" - Baba Ram Dass