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:
parent
5ebf982ceb
commit
b9e020cb19
@ -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))}'
|
||||
|
Loading…
x
Reference in New Issue
Block a user