From: Steven Baltakatei Sandoval Date: Thu, 25 Jul 2024 18:13:49 +0000 (+0000) Subject: fix(user/bkots):Remove unnecessary backslash escaping X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/8378a004f4c28569f463bf39da4ffe32f7d41167?ds=inline;hp=26ab84d93abd3ccaa2b2c8871a8dfc9e937c06e7 fix(user/bkots):Remove unnecessary backslash escaping --- diff --git a/user/bkots b/user/bkots index b38f0ac..a7f61ee 100755 --- a/user/bkots +++ b/user/bkots @@ -200,7 +200,7 @@ showVersion() { vbm "DEBUG:showVersion function called." cat <<'EOF' -bkots 2.0.1 +bkots 2.0.2 Copyright (C) 2022 Steven Baltakatei Sandoval License GPLv3: GNU GPL version 3 This is free software; you are free to change and redistribute it. @@ -406,7 +406,6 @@ main() { # Ref/Attrib: [1] How to create an array of unique elements from a string/array in bash https://unix.stackexchange.com/a/167194 # [2] How to find files containing newlines in their names https://stackoverflow.com/a/21727028 # [3] Get mtime of specific file using Bash? https://stackoverflow.com/a/4774377 - # [4] Search/Replace with string substitution instead of sed. https://www.shellcheck.net/wiki/SC2001 local -a file_list file_list_pruned; local -a files_to_verify files_to_upgrade files_to_stamp local -a files_to_verify_pruned files_to_upgrade_pruned files_to_stamp_pruned @@ -672,7 +671,6 @@ main() { ## Assemble and execute upgrade file commands for item in "${files_to_upgrade_pruned[@]}"; do path_prf="$(cut -d $'\n' -f1 < <(echo "$item"))"; - path_prf_sesc="${path_prf//\"/\\\"}"; # escape path double quotes. See [4]. if [[ -z "$path_prf" ]]; then yell "ERROR:blank upgrade item encountered. Skipping:item:$item"; continue; @@ -688,7 +686,7 @@ main() { cmd_temp+=("ots"); if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi; cmd_temp+=("-l" "$url" "--no-default-whitelist"); - cmd_temp+=("upgrade" "$path_prf_sesc"); + cmd_temp+=("upgrade" "$path_prf"); if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi; #### execute command @@ -706,8 +704,6 @@ main() { for item in "${files_to_verify_pruned[@]}"; do path_src="$(cut -d $'\n' -f1 < <(echo "$item"))"; path_prf="$(cut -d $'\n' -f2 < <(echo "$item"))"; - path_src_sesc="${path_src//\"/\\\"}"; # escape path double quotes. See [4]. - path_prf_sesc="${path_prf//\"/\\\"}"; # escape path double quotes. See [4]. if [[ -z "$path_src" ]] || [[ -z "$path_prf" ]]; then yell "ERROR:blank verify item encountered. Skipping:item:$item"; continue; @@ -724,7 +720,7 @@ main() { cmd_temp+=("ots"); if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi; cmd_temp+=("-l" "$url" "--no-default-whitelist"); - cmd_temp+=("verify" "-f" "$path_src_sesc" "$path_prf_sesc"); + cmd_temp+=("verify" "-f" "$path_src" "$path_prf"); if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi; #### execute command @@ -741,7 +737,6 @@ main() { ## Assemble and execute stamp file commands for item in "${files_to_stamp_pruned[@]}"; do path_src="$(cut -d $'\n' -f1 < <(echo "$item"))"; - path_src_sesc="${path_src//\"/\\\"}"; # escape path double quotes. See [4]. if [[ -z "$path_src" ]]; then yell "ERROR:blank stamp item encountered. Skipping:item:$item"; continue; @@ -753,7 +748,7 @@ main() { local -a cmd_temp; cmd_temp+=("ots"); if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi; - cmd_temp+=("stamp" "$path_src_sesc"); + cmd_temp+=("stamp" "$path_src"); if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi; #### execute command