From: Nicolas Boisselier Date: Thu, 6 Apr 2023 19:48:22 +0000 (+0200) Subject: sys_model() Add new line, exit from awk after one print X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=dc2ff95900291f951704ef3d4c595e3e920c7d67;p=nb.git sys_model() Add new line, exit from awk after one print --- diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index b565ac9f..0bc8cd6f 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -48,9 +48,9 @@ sys_model() { ;; *) if [ -e /proc/device-tree/model ]; then - tr -d '\000' < /proc/device-tree/model + tr -d '\000' < /proc/device-tree/model && echo elif which lshw > /dev/null; then - lshw -quiet -class system 2>/dev/null | awk -F': ' '/product: /{print $2}' + lshw -quiet -class system 2>/dev/null | awk -F': ' '/product: /{print $2; exit}' fi ;; esac