From 87512412cc7c938f48eac8c7d6e72f9834299569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Sat, 22 Jun 2024 05:09:08 +0900 Subject: =?UTF-8?q?SunOS:=20CPU=E3=81=A8=E3=83=9B=E3=82=B9=E3=83=88?= =?UTF-8?q?=E5=90=8D=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cpu.c | 6 +++--- src/host.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cpu.c b/src/cpu.c index 780cba1..72d86f6 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -16,9 +16,9 @@ const char *display_cpu() { "sed 's/(TM)//' | sed 's/CPU //' | sed 's/Processor//' && " "echo \" (\" && sysctl -n hw.ncpu && echo \" core)\""); #elif defined(__sun) - return run_command_s("psrinfo -pv | tail -1 | sed 's/(r)//g' | " - "sed 's/ CPU//' | sed 's/^ *//' && " - "echo \" (\" && psrinfo -p && echo \" core)\""); + return run_command_s("psrinfo -pv | tail -1 | " + "sed 's/(r)//g; s/ CPU//; s/^ *//; s/ $//' | awk '{$1=$1};1' && " + "echo \" (\" && psrinfo -p && echo \" core)\""); #elif defined(__linux__) char buf[20]; long int val; diff --git a/src/host.c b/src/host.c index 77020ae..985b90a 100644 --- a/src/host.c +++ b/src/host.c @@ -95,7 +95,7 @@ void display_host_model() { free((void *)cmd); #elif defined(__sun) const char *cmd = run_host_command("smbios | grep \"Product\" | " - "sed 's/ Product: //' | head -1"); + "sed 's/ Product: //' | awk '{$1=$1};1' | head -1"); if (!cmd) return; printf("%s", cmd); free((void *)cmd); -- cgit v1.2.3