LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-05-2016, 11:57 PM   #1
aristosv
Member
 
Registered: Dec 2014
Posts: 263

Rep: Reputation: 3
inserting command output in specific html table


I use the following commands in a bash script, to output the CPU and disk usage on a computer.

I would like to import this output directly in an HTML file with tables.

How can I get the ouput of these commands to go in a specific table, as shown in the HTML code below?

Code:
echo $[100-$(vmstat|tail -1|awk '{print $15}')]'%'
df -h /dev/sda1 | awk 'NR>1{print $5}'
Code:
<html>
<head>
<title>Report</title>
</head>
<body>
<table>
	<tr>
		<td></td>
		<td>CPU Usage</td>
		<td>Disk Usage</td>
	</tr>
	<tr>
		<td>Computer1</td>
		<td></td>
		<td></td>
	</tr>
	</table>

</body>
</html>
 
Old 04-06-2016, 03:19 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
are you asking how to write a shell script that will produce an html file with the desired output?
or do you want to use this as a live web page?

the former is trivial, the latter will require server-side scripting, most probably php.
there's ample php documentation, tutorials and whatnot in the wild, wild web.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Running a command and see the output in terminal in specific time. hack3rcon Linux - Newbie 6 12-06-2015 05:02 AM
Pipe command output to MySQL table thealmightyos Linux - General 4 10-11-2014 12:13 PM
Need single table output from 2 sar command outputs mohdkmn Linux - Newbie 4 10-19-2013 09:30 AM
Parse HTML and print specific table seattleweb Programming 4 05-13-2009 04:25 AM
howto print output of mount command as a table? ygloo Programming 8 10-18-2006 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration