LinuxQuestions.org
Review your favorite Linux distribution.
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-06-2016, 12:57 AM   #1
aristosv
Member
 
Registered: Dec 2014
Posts: 197

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, 04:19 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,422
Blog Entries: 9

Rep: Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669Reputation: 3669
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:02 AM
Pipe command output to MySQL table thealmightyos Linux - General 4 10-11-2014 01:13 PM
Need single table output from 2 sar command outputs mohdkmn Linux - Newbie 4 10-19-2013 10:30 AM
Parse HTML and print specific table seattleweb Programming 4 05-13-2009 05:25 AM
howto print output of mount command as a table? ygloo Programming 8 10-18-2006 02:32 PM

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

All times are GMT -5. The time now is 12:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration