From a4a30f2af1e0eefdd7c420588107ae086bacdbf8 Mon Sep 17 00:00:00 2001 From: tuxwarrior Date: Wed, 1 May 2024 15:50:01 -0500 Subject: [PATCH] u --- scripts/99_software.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/99_software.sh b/scripts/99_software.sh index 53f8ca1..451ae2e 100644 --- a/scripts/99_software.sh +++ b/scripts/99_software.sh @@ -64,8 +64,8 @@ if [ ${operation} == "update" ] ; then fi # https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash - packages_no_comments < sed '/^[[:blank:]]*#/d;s/#.*//' ${x} - mapfile -t packages < ${packages_no_comments} + sed '/^[[:blank:]]*#/d;s/#.*//' ${trg_file} > ${trg_file}.tmp + mapfile -t packages < ${trg_file}.tmp installed=$(pacman -Qq) list=() @@ -76,11 +76,9 @@ if [ ${operation} == "update" ] ; then echo "Skipping (1) $x" elif [[ $installed != *$x* ]] then - if [[ $(echo "$installed" | grep -E -o "^$x$") != $x ]] - then - #grep -o '^[^#]*' ${x} > x - echo "Adding $x to list" - list+="$x " + if [[ $(echo "$installed" | grep -E -o "^$x$") != $x ]] then + echo "Adding $x to list" + list+="$x " else echo "Skipping (2) $x" fi