From 43c7016c3481b69d006af1222987752a4d04bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Schmidts?= Date: Mon, 10 Jun 2013 09:58:29 +0200 Subject: [PATCH] _lp_temp_sensors : a better use of sed closes #189 --- liquidprompt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/liquidprompt b/liquidprompt index b1a9689..154d40a 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1217,8 +1217,8 @@ _lp_load_color() _lp_temp_sensors() { # Return the hottest system temperature we get through the sensors command local temperature=0 - for i in $(sensors | grep -E "^(CPU|SYS|MB|Core|temp).*°(C|F)" | - sed -r "s/.*: *\+([0-9]*)\..°.*/\1/g"); do + for i in $(sensors | + sed -n -r "s/^(CPU|SYS|MB|Core|temp).*: *\+([0-9]*)\..°.*/\2/p"); do if [[ $i -gt $temperature ]]; then temperature=$i fi