From 9fed1e4e4b78e355e9ee17ff5f87f7e5194bb9e6 Mon Sep 17 00:00:00 2001 From: Patrick Talbert Date: Wed, 15 Jul 2020 11:22:13 +0200 Subject: [PATCH] Make _parse_periphs() gawk case insensitive Some devices have an unexpected PCI class so the original XSOS_LSPCI_*_REGEX will miss them. We relax the pattern matching by making it case insensitive and removing the colon. Fixes: #10 Signed-off-by: Patrick Talbert --- xsos | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xsos b/xsos index f9631ea..bb8631e 100755 --- a/xsos +++ b/xsos @@ -187,7 +187,7 @@ fi # XSOS_LSPCI_NET_REGEX (str: regular expression) # Configures what LSPCI() uses to search for peripherals under the "Net" heading - : ${XSOS_LSPCI_NET_REGEX:="(Ethernet controller|Network controller|InfiniBand)( \[[0-9]{4}\])?:"} + : ${XSOS_LSPCI_NET_REGEX:="(Ethernet controller|Network controller|InfiniBand)( \[[0-9]{4}\])?"} # XSOS_LSPCI_STORAGE_REGEX (str: regular expression) # Configures what LSPCI() uses to search for peripherals under the "Storage" heading @@ -2024,7 +2024,7 @@ LSPCI() { _parse_periphs() { local regex=${1} - gawk -vH_IMP="${c[Imp]}" -vH2="${c[H2]}" -vH0="${c[0]}" " + gawk -v IGNORECASE=1 -vH_IMP="${c[Imp]}" -vH2="${c[H2]}" -vH0="${c[0]}" " /${regex}/"'{ # Save split($1, slot, ":")