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
This commit is contained in:
Ludovic Rousseau 2012-08-21 23:49:55 +02:00
parent 5ebf982ceb
commit b9e020cb19

View File

@ -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))}'