Skip to content

Commit

Permalink
xuname: avoid "cat abuse" and run awk directly on /proc/cpuinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiKettunen authored and leahneukirchen committed Sep 12, 2022
1 parent 1aa10d7 commit 0a06ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xuname
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ OUTDATED=$(xbps-install -Mun)
HOLD=$(xbps-query -H)
VM=$(dmesg 2>/dev/null | awk '/Hypervisor detected/{print $NF}')
[ -z "$VM" ] && grep -q hypervisor /proc/cpuinfo && VM=VM
CPU=$(cat /proc/cpuinfo |awk '/^vendor_id/{print $NF;exit}')
[ -z "$CPU" ] && CPU=$(cat /proc/cpuinfo |awk '/^platform/{print $NF;exit}')
CPU=$(awk '/^vendor_id/{print $NF;exit}' /proc/cpuinfo)
[ -z "$CPU" ] && CPU=$(awk '/^platform/{print $NF;exit}' /proc/cpuinfo)
REPO=$(xbps-query --regex -p repository -s '.' | cut -d/ -f2- | sort -u | awk '
/^\/repo-default.voidlinux.org\/current\/multilib/ {m=m"m"}
/^\/repo-default.voidlinux.org\/current\/debug/ {d=d"d"}
Expand Down

0 comments on commit 0a06ddd

Please sign in to comment.