From 270eae5fc922f6fa5c48bd64cce41c249e3d361e Mon Sep 17 00:00:00 2001 From: awalsh128 Date: Sat, 4 Feb 2023 21:08:45 -0800 Subject: [PATCH] Remove commas, and block scalar folded backslashes #84 --- lib.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib.sh b/lib.sh index c2f1ec9..aded419 100755 --- a/lib.sh +++ b/lib.sh @@ -118,14 +118,15 @@ function log_err { >&2 echo "$(date +%H:%M:%S)" "${@}"; } function log_empty_line { echo ""; } ############################################################################### -# Sorts given packages by name and split on commas. +# Sorts given packages by name and split on commas and/or spaces. # Arguments: -# The comma delimited list of packages. +# The comma and/or space delimited list of packages. # Returns: # Sorted list of space delimited packages. ############################################################################### function normalize_package_list { - local stripped=$(echo "${1}" | sed 's/,//g') + # Remove commas, and block scalar folded backslashes. + local stripped=$(echo "${1}" | sed 's/[,\]/ /g') # Remove extraneous spaces at the middle, beginning, and end. local trimmed="$(\ echo "${stripped}" \