LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-24-2001, 10:35 PM   #1
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
command line text formating anyone?


I have a web page that is dynamically built using echo and sensors.

I want to filter and format the output of sensors.

I want to pipe the lines through something to filter them so that I don't get the (min = +1.60 V, max = +1.67 V) stuff

I know this has got to be very simple but have not done a lot of this stuff.

here is a sample of what I have viewed in a web browser......


System Voltages

CPU core: +1.62 V (min = +1.60 V, max = +1.67 V)

I/O: +3.41 V (min = +3.38 V, max = +3.44 V)

+5V: +4.97 V (min = +4.95 V, max = +5.05 V)

+12V: +12.18 V (min = +11.94 V, max = +12.24 V)

System Temperatures

CPU Temp: +119.9°F (limit = +131°F, hysteresis = +140°F)

SYS Temp: +97.7°F (limit = +113°F, hysteresis = +121°F)

this is built like this


OF=/var/www/html/sysmon.html
sensors -s

echo "<html>" > $OF

echo "<b>Page Last Updated: </b>" >> $OF

date >> $OF

echo "<p>" >> $OF

echo "<b>System Up Since: </b>" >> $OF

cat /var/log/up.log >> $OF

echo "<p>" >> $OF

echo "<b>System Voltages</b>" >> $OF

echo "<p>" >> $OF

sensors -f |grep "CPU core" >> $OF

echo "<p>" >> $OF

sensors -f |grep "I/O" >> $OF

echo "<p>" >> $OF

sensors -f |grep "+5V" >> $OF

echo "<p>" >> $OF






 
Old 11-25-2001, 04:30 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
sensors -f | grep "CPU core" | cut -d"(" -f1

bosh.

incidentally, you have the same name as my dad, so when you post, i always think of him. awwwwwwww
 
Old 11-25-2001, 06:26 PM   #3
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Original Poster
Rep: Reputation: 58


Thanks for the info it will open a few more possibilities.


Cool, I have a son with the same name.


 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Enhanced command line text editor netsoft2005 Linux - Software 2 07-14-2005 07:42 AM
chpasswd from a command line (without a text file) mpgram Linux - Security 1 04-18-2004 05:44 PM
Copy text from command line Duukkis Linux - General 8 08-25-2003 01:29 PM
VI text editor in command line InSane103 Linux - Software 4 07-09-2003 09:04 PM
Command line Text Terri Linux - General 8 04-05-2002 03:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:03 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