From 3bc621579a05c8a61e7aba71baca64a07ca9594a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 25 Sep 2019 18:50:00 +0300 Subject: [PATCH] netbsd: host information --- pfetch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pfetch b/pfetch index fa34aa1..41c2679 100755 --- a/pfetch +++ b/pfetch @@ -216,6 +216,22 @@ get_host() { host=$(sysctl -n hw.model) ;; + NetBSD*) + # Use 'set --' to store the output of the command + # as it normalizes whitespace and strips newlines. + # + # Disable the shellcheck warning for word-splitting + # as it's safe and intended ('set -f' disables globbing). + # shellcheck disable=2046 + { + set -f + set +f -- $(sysctl -n machdep.dmi.system-vendor \ + machdep.dmi.system-product) + } + + host=$* + ;; + *BSD*) # Use 'set --' to store the output of the command # as it normalizes whitespace and strips newlines.