From 1b4e007425d14516cf4b0c4550911af8b1052397 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 19 Oct 2021 19:31:26 -0700 Subject: [PATCH] scripts/installer.sh: use expr for regex matches. =~ doesn't work in posix shell, only in bash, and we don't use bash. Signed-off-by: David Anderson --- scripts/installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/installer.sh b/scripts/installer.sh index 80d58f633..aebb0c36f 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -38,7 +38,7 @@ main() { PACKAGETYPE="apt" # Third-party keyrings became the preferred method of # installation in Ubuntu 20.04. - if [ "$VERSION_ID" =~ ^2 ]; then + if expr "$VERSION_ID" : "2.*" >/dev/null; then APT_KEY_TYPE="keyring" else APT_KEY_TYPE="legacy" @@ -72,7 +72,7 @@ main() { OS="$ID" VERSION="$VERSION_ID" PACKAGETYPE="dnf" - if [ "$VERSION" =~ ^7 ]; then + if expr "$VERSION" : "7.*" >/dev/null; then PACKAGETYPE="yum" fi ;;