ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I would like a question. I will be doing script that will extract data/logs from other servers. What will be the best to put it in html so that i can display in apache?
Do i actually build up the html while the data is being collected? ie everything runs from a script?
or should i extract the data, then have another script to sort out the relevant information to build a page?
Sorry that i dun have much knowledge on this? Pls kindly assist. Thanks.
Follow something which is very common. Build the web page with PHP. If you have a lot of data and/or you want to see history, put it in a MySQL database and retrieve it from there. If the information is not much, you can integrate data retrieval and page building in one PHP script. Even if you use separate scripting to retrieve data and put it in MySQL, you can use PHP as command line script.
I started using this approach 1.5 years ago and got something up and running in one weekend. Good explanation and plenty of examples on www.php.net
hi..i managed to incorporate the building of the website into the script. Currently, i'm facing a little issue over here. i can retrieve the log over( using sftp, then rename it to html ) but in it contains < > symbols....which the contents in it is important and i want to retain it. or is there any way to display the .log directly onto the page?
Some example
<xxxx.xxxx: Error:Sat Sep 08 11:35:55 2007>
Transport node error on node 0x1233
<END>
Using sed or so, replace all '<' '>' and with ampersand#060; and ampersand#060; respectively. Ampersand is the '&' symbol but I cannot write the string here, because the browser translates that to < and >. You also might try to use <pre> and </pre> labels around your log part but I am not sure that works.
That is correct Bash syntax. It yields 'aaabbb' for $B. The other two are syntactically correct, but do not change $B. If you use
Code:
echo "bbb" >> ${A}
you would echo the 'bbb' string into a file called 'aaa'.
If you use
Code:
cat "bbb" >> ${A}
you would echo the contents of the file 'bbb' string into a file called 'aaa'.
You can try such constructs easily in a console, and verify that they work.
Note that in my previous post I had a typo concerning the code for '>' That should be ampersand#062; instead of ampersand#060; I wrote the same string twice.
Try to do a
${A}=${A}bbb ....but it seems that it cant pass there's a problem with the 1st ${A}.
what i do not is create a tmp file and echo the messages in there which i think isn't efficient
2nd
i try to sed < for & #60 and > for & #62 but it still show as <#060 and >#062
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.