Hello all,

What I am trying to do is run a command and take a very specific part of
a line of its output and save it to a file. Here's the route i've been
going down so far... with no success might I add.

the program im running is called sensors (lm_sensors) and run on its own
gives output of the temperatures of a handful of devices... I've
narrowed the output down to just the line im interested in with the
command

sensors |grep CPU: |cat > cpu

which gives me a file called cpu with contents: -
CPU:       +53.4?C  (limit = +120?C, hysteresis = +100?C)

the problem im having is that i need the file to just contain: -
53.4

or whatever the value was when sensors was run. i've tried variations of
this command like: -

sensors |grep CPU: |grep -o +##.#? |cat > cpu

but i just cant find a way to get it to do what i want. If any of you
know the command that will give me the output I'm looking for, or know a
different way of doing it, that would be fantastic.

Thanks in advance,
Adam Bowns


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to