changed to awk command, added netbsd and windows

This commit is contained in:
Andrew Titmuss 2016-03-15 18:24:12 +11:00
parent 890d44c518
commit 26c04cf753
1 changed files with 4 additions and 1 deletions

View File

@ -851,7 +851,7 @@ getcpu () {
cpu="$cpu @ ${speed}GHz"
# Get cpu cores
cores=$(nproc)
cores=$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)
;;
"Mac OS X")
@ -897,6 +897,9 @@ getcpu () {
"NetBSD"*) speed=$((speed / 10000)) ;;
"Windows"*) speed=$((speed / 100000)) ;;
esac
# Get cpu cores
cores=$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)
;;
esac