]> git.alsa-project.org Git - alsa-utils.git/commit
alsa-info.sh: uname - reduce execs by four, and eliminate a logic bug
authorwileyhy <84648683+wileyhy@users.noreply.github.com>
Sat, 29 Apr 2023 02:57:20 +0000 (19:57 -0700)
committerJaroslav Kysela <perex@perex.cz>
Wed, 3 May 2023 14:36:04 +0000 (16:36 +0200)
commit37e396cab4edd01384916e8310fae01ab67b53c3
tree50996cbd1bdaa9a9eb9cdd77642fb037dec1c2c2
parent4588b2f8aebb00f94ecd9b6029ddb0de82fd6d94
alsa-info.sh: uname - reduce execs by four, and eliminate a logic bug

Per `info uname`, `uname` always prints its data in the same order.
Also, "note that A && B || C is not if-then-else. C may run when A is true."
https://www.shellcheck.net/wiki/SC2015

set -x; read -r KERNEL_VERSION < <(uname -v); smp=x; \
  [[ "$KERNEL_VERSION" = *SMP* ]] && \
  { smp=y; readonly smp; false;} || smp=n; set -

  ... https://github.com/koalaman/shellcheck

Fixes: https://github.com/alsa-project/alsa-utils/pull/207
From: wileyhy @ github
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsa-info/alsa-info.sh