From 02a9bd84afa00c6ffde9f7297a533b30476b608b Mon Sep 17 00:00:00 2001 From: Crestwave Date: Mon, 30 Sep 2019 15:32:54 +0800 Subject: [PATCH] pfetch: code style changes --- pfetch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pfetch b/pfetch index 2e7074c..ae8a682 100755 --- a/pfetch +++ b/pfetch @@ -468,8 +468,8 @@ get_pkgs() { ;; SunOS) - has pkginfo && pkginfo -i - has pkg && pkg list + has pkginfo && pkginfo -i + has pkg && pkg list ;; esac | wc -l ` @@ -631,8 +631,11 @@ get_memory() { SunOS) hw_pagesize=$(pagesize) - while read -r _ p; do - : "${pages_total:+"${pages_free="$p"}"}" "${pages_total="$p"}" + while read -r key val; do + case $key in + *total) pages_total=$val ;; + *free) pages_free=$val ;; + esac done <<-EOF $(kstat -p unix:0:system_pages:pagestotal \ unix:0:system_pages:pagesfree)