From 951732fc1b07823e8f7c6b4cbfd28f753f1a8e50 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 17 Jun 2019 16:28:55 -0700 Subject: [PATCH] Use an array for PKG_REMOVE Fixes shellcheck warning. Signed-off-by: Mcat12 --- automated install/uninstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 8e5c5455..1f58b887 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -55,13 +55,13 @@ fi # Compatability if [ -x "$(command -v apt-get)" ]; then # Debian Family - PKG_REMOVE="${PKG_MANAGER} -y remove --purge" + PKG_REMOVE=("${PKG_MANAGER}" -y remove --purge) package_check() { dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed" } elif [ -x "$(command -v rpm)" ]; then # Fedora Family - PKG_REMOVE="${PKG_MANAGER} remove -y" + PKG_REMOVE=("${PKG_MANAGER}" remove -y) package_check() { rpm -qa | grep "^$1-" > /dev/null } @@ -80,7 +80,7 @@ removeAndPurge() { case ${yn} in [Yy]* ) echo -ne " ${INFO} Removing ${i}..."; - ${SUDO} ${PKG_REMOVE} "${i}" &> /dev/null; + ${SUDO} "${PKG_REMOVE}" "${i}" &> /dev/null; echo -e "${OVER} ${INFO} Removed ${i}"; break;; [Nn]* ) echo -e " ${INFO} Skipped ${i}"; break;;