Skip to contentSkip to conversation

ver_linux: use lscpu command result instead of /proc/cpuinfo

PATCH New Masayoshi Mizuma 2 participants 2 messages Sep 27, 2018 – Oct 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ver_linux: use lscpu command result instead of /proc/cpuinfo

From: Masayoshi Mizuma <[email protected]>

lscpu command shows the cpu information clearly. So let's use the result if the command is installed to the system.

---
 ver_linux | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
ver_linux +6 -2
index dda337926..320b624a1 100755
@@ -96,5 +96,9 @@ echo 'free reports:'
 free
 
 echo
-echo '/proc/cpuinfo'
-cat /proc/cpuinfo
+echo 'cpuinfo:'
+if which lscpu > /dev/null 2>&1; then
+	lscpu
+else
+	cat /proc/cpuinfo
+fi
Signature · 1 line
2.19.0