ver_linux: use lscpu command result instead of /proc/cpuinfo
PATCH 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.
Signed-off-by Masayoshi Mizuma <[email protected]>
--- ver_linux | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
ver_linux +7 -2
@@ -96,5 +96,10 @@ echo 'free reports:' free echo -echo '/proc/cpuinfo' -cat /proc/cpuinfo +echo 'cpuinfo:' +which lscpu > /dev/null 2>&1 +if [ $? -eq 0 ]; then + lscpu +else + cat /proc/cpuinfo +fi
Signature · 1 line
2.18.0
PATCH 1/1 ver_linux: use lscpu command result instead of /proc/cpuinfo
Hi!
Quoted 10 lines
Signed-off-by Masayoshi Mizuma <[email protected]>--- ver_linux | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)ver_linux +0
-0
ver_linux echo 'free reports:' · line 101
Quoted 8 lines
ver_linux +3
-2@@ -96,5 +96,10 @@ echo 'free reports:' free echo -echo '/proc/cpuinfo' -cat /proc/cpuinfo +echo 'cpuinfo:' +which lscpu > /dev/null 2>&1 +if [ $? -eq 0 ]; then
You can just write:
if which lscpu > /dev/null 2>&1; then
...
Other than that it's fine.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 ver_linux: use lscpu command result instead of /proc/cpuinfo
Quoted 22 lines · Cyril Hrubis
Hi!
Quoted 10 lines
Signed-off-by Masayoshi Mizuma <[email protected]>--- ver_linux | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)ver_linux +0
-0ver_linux echo 'free reports:' · line 101
Quoted 8 lines
ver_linux +3
-2@@ -96,5 +96,10 @@ echo 'free reports:' free echo -echo '/proc/cpuinfo' -cat /proc/cpuinfo +echo 'cpuinfo:' +which lscpu > /dev/null 2>&1 +if [ $? -eq 0 ]; thenYou can just write:
Quoted 5 lines
if which lscpu >
/dev/null2>&1; then
...Other than that it's fine.
Thanks! I'll send the v2 soon.
- Masa