• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Another Ubuntu 6.10 Question: Printing the results of a program into an HTML file?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
Originally posted by: Alone
00,15,30,45 * * * * echo "<pre>"`/usr/local/bin/tw_cli /c0/u0 show`"</pre>" > /var/www/status.html

EDIT: Ah, you got it.

I PMed you the link earlier didn't I? You can see the current output.

Better but still not where I want it...what I see at the command line is what I would like to see in the HTML file.
 
Originally posted by: Alone
Echo isn't preserving the line breaks, it seems. Hm..

LOL. It's really just me being anal about formatting.

This really isn't worth people sweating over but the help is indeed appreciated 🙂
 
Originally posted by: GTaudiophile
Originally posted by: Alone
Echo isn't preserving the line breaks, it seems. Hm..

LOL. It's really just me being anal about formatting.

This really isn't worth people sweating over but the help is indeed appreciated 🙂

Bah, it's a chance to learn. 😉
 
Originally posted by: GTaudiophile
Is it possible to have three seperate commands write to the same HTML file?

Sure. Just echo like we were before. The first command should use one ">" to replace the existing contents, the next two should use two ">"'s to append to the existing output. Now it'll be something like...

echo `/usr/local/bin/tw_cli /c0/u0-0 show` > /var/www/status.html && echo `/usr/local/bin/tw_cli /c0/u0-1 show` >> /var/www/status.html
 
I had the solution a while ago.

But I just figures out that ' does not mean `.

Bloody syntax.

Anyway, if you check out the status.html you will see my final product.

I am happy.
 
I basically found a new command for the utility. Instead of show, I used

info c0 u0 status = status of the entire RAID array

info c0 p0 status = status of drive 0

info c0 p1 status = status of drive 1

 
Originally posted by: GTaudiophile
Nice.

I think I need more info on the HTML formatting part.

you'd probably have to write a script or something.


'/usr/local/bin/tw_cli /c0/u0 show' | thescript > x.html
 
to format it it you are going to ether be writing a large shell script, bash, perl, php, python, ruby, etc can all accomplish this.
 
Back
Top