From 2ba2a51b9c6299d7b714d0f98b89559ed506a132 Mon Sep 17 00:00:00 2001 From: biskyt Date: Thu, 4 Nov 2021 17:07:24 +0000 Subject: [PATCH] ignore blank lines in arrays --- protected/scripts/backupdb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/scripts/backupdb.sh b/protected/scripts/backupdb.sh index 3aa983723d..9077179fb4 100644 --- a/protected/scripts/backupdb.sh +++ b/protected/scripts/backupdb.sh @@ -138,7 +138,7 @@ DONT_CALCULATE_LIST="" EXCLUDED_TABLES_STRING='' for TABLE in "${EXCLUDED_TABLES[@]}"; do : - if [ "${TABLE}" != "ignore_none" ]; then + if [ "${TABLE}" != "ignore_none" ] && [ -n "$TABLE" ]; then echo "Excluding data for: ${DATABASE}.${TABLE}" EXCLUDED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}" DONT_CALCULATE_LIST+="'${TABLE}', " @@ -149,7 +149,7 @@ done IGNORED_TABLES_STRING='' for TABLE in "${IGNORED_TABLES[@]}"; do : - if [ "${TABLE}" != "ignore_none" ]; then + if [ "${TABLE}" != "ignore_none" ] && [ -n "$TABLE" ]; then echo "Ignoring: ${DATABASE}.${TABLE}" IGNORED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}" DONT_CALCULATE_LIST+="'${TABLE}', "