From 804ce01aca9f60080ece774ec2f7b0cb7a0e3fe9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 7 May 2023 14:08:16 +0200 Subject: [PATCH] use single-quotes for sed regex-patterns While I haven't found cases where this caused issues, it probably doesn't hurt to use single-quotes for these to prevent globbing. Signed-off-by: Sebastiaan van Stijn --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index f262b70..e26b1af 100755 --- a/install.sh +++ b/install.sh @@ -427,7 +427,7 @@ do_install() { echo "# WARNING: VERSION pinning is not supported in DRY_RUN" else # Will work for incomplete versions IE (17.12), but may not actually grab the "latest" if in the test channel - pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/~ce~.*/g" | sed "s/-/.*/g")" + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/~ce~.*/g' | sed 's/-/.*/g')" search_command="apt-cache madison 'docker-ce' | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3" pkg_version="$($sh_c "$search_command")" echo "INFO: Searching repository for VERSION '$VERSION'" @@ -505,7 +505,7 @@ do_install() { if is_dry_run; then echo "# WARNING: VERSION pinning is not supported in DRY_RUN" else - pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/\\\\.ce.*/g" | sed "s/-/.*/g").*$pkg_suffix" + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/\\\\.ce.*/g' | sed 's/-/.*/g').*$pkg_suffix" search_command="$pkg_manager list --showduplicates 'docker-ce' | grep '$pkg_pattern' | tail -1 | awk '{print \$2}'" pkg_version="$($sh_c "$search_command")" echo "INFO: Searching repository for VERSION '$VERSION'" @@ -587,7 +587,7 @@ do_install() { if is_dry_run; then echo "# WARNING: VERSION pinning is not supported in DRY_RUN" else - pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/\\\\.ce.*/g" | sed "s/-/.*/g")" + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/\\\\.ce.*/g' | sed 's/-/.*/g')" search_command="zypper search -s --match-exact 'docker-ce' | grep '$pkg_pattern' | tail -1 | awk '{print \$6}'" pkg_version="$($sh_c "$search_command")" echo "INFO: Searching repository for VERSION '$VERSION'"