From b9e020cb194095cdc548531801b124d2eceaf971 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Tue, 21 Aug 2012 23:49:55 +0200 Subject: [PATCH] Fix Darwnin _lp_cpu_load() With the previous code I get an error before each prompt: -bash: $/dev/fd/62: No such file or directory Maybe the same code can't be used for both Darwnin and FreeBSD. I reuse the code removed in 2a833475bc6661a59b5eecc4f8aa343f4bb1977b --- liquidprompt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 5c5d4e3..e067be6 100755 --- a/liquidprompt +++ b/liquidprompt @@ -161,13 +161,20 @@ case "$LP_OS" in echo "$load" } ;; - FreeBSD|Darwin) + FreeBSD) _lp_cpu_load () { local bol load eol read bol load eol < $<( LANG=C sysctl -n vm.loadavg ) echo "$load" } ;; + Darwin) + _lp_cpu_load () { + local load + load=$(LANG=C sysctl -n vm.loadavg | awk '{print $2}') + echo "$load" + } + ;; SunOS) _lp_cpu_load () { LANG=C uptime | awk '{print substr($10,0,length($10))}'