_lp_temp_sensors : a better use of sed

closes #189
This commit is contained in:
François Schmidts 2013-06-10 09:58:29 +02:00
parent 4610756387
commit 43c7016c34

View File

@ -1217,8 +1217,8 @@ _lp_load_color()
_lp_temp_sensors() { _lp_temp_sensors() {
# Return the hottest system temperature we get through the sensors command # Return the hottest system temperature we get through the sensors command
local temperature=0 local temperature=0
for i in $(sensors | grep -E "^(CPU|SYS|MB|Core|temp).*°(C|F)" | for i in $(sensors |
sed -r "s/.*: *\+([0-9]*)\..°.*/\1/g"); do sed -n -r "s/^(CPU|SYS|MB|Core|temp).*: *\+([0-9]*)\..°.*/\2/p"); do
if [[ $i -gt $temperature ]]; then if [[ $i -gt $temperature ]]; then
temperature=$i temperature=$i
fi fi