fix(user/bkots):Remove unnecessary backslash escaping
[BK-2020-03.git] / user / bkots
index cca1fd803ec7a11bc0169351e951be0caaa02b2c..a7f61ee8414a158253fe1964bd93f5d1156a6296 100755 (executable)
@@ -200,7 +200,7 @@ showVersion() {
     vbm "DEBUG:showVersion function called."
 
     cat <<'EOF'
     vbm "DEBUG:showVersion function called."
 
     cat <<'EOF'
-bkots 2.0.0
+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.
 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
     # 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
     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"))";
     ## 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;
         if [[ -z "$path_prf" ]]; then
             yell "ERROR:blank upgrade item encountered. Skipping:item:$item";
             continue;
@@ -688,11 +686,11 @@ main() {
                 cmd_temp+=("ots");
                 if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi;
                 cmd_temp+=("-l" "$url" "--no-default-whitelist");
                 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
                 if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi;
 
                 #### execute command
-                wait_for_jobslot && must "${cmd_temp[@]}" &
+                wait_for_jobslot && "${cmd_temp[@]}" &
                 unset cmd_temp;
                 break;
                 #ots -l "$url" --no-default-whitelist upgrade "$path_prf" && break;
                 unset cmd_temp;
                 break;
                 #ots -l "$url" --no-default-whitelist upgrade "$path_prf" && break;
@@ -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"))";
     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;
         if [[ -z "$path_src" ]] || [[ -z "$path_prf" ]]; then
             yell "ERROR:blank verify item encountered. Skipping:item:$item";
             continue;
@@ -724,11 +720,11 @@ main() {
                 cmd_temp+=("ots");
                 if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi;
                 cmd_temp+=("-l" "$url" "--no-default-whitelist");
                 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
                 if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi;
 
                 #### execute command
-                wait_for_jobslot && must "${cmd_temp[@]}" &
+                wait_for_jobslot && "${cmd_temp[@]}" &
                 unset cmd_temp;
                 break;
                 #ots -l "$url" --no-default-whitelist verify -f "$path_src" "$path_prf" && break;
                 unset cmd_temp;
                 break;
                 #ots -l "$url" --no-default-whitelist verify -f "$path_src" "$path_prf" && break;
@@ -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"))";
     ## 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;
         if [[ -z "$path_src" ]]; then
             yell "ERROR:blank stamp item encountered. Skipping:item:$item";
             continue;
@@ -753,11 +748,11 @@ main() {
             local -a cmd_temp;
             cmd_temp+=("ots");
             if [[ "$opVerbose" = "true" ]]; then cmd_temp+=("-v"); fi;
             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
             if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi;
 
             #### execute command
-            wait_for_jobslot && must "${cmd_temp[@]}" &
+            wait_for_jobslot && "${cmd_temp[@]}" &
             unset cmd_temp;
             #ots stamp "$path_src";
         else
             unset cmd_temp;
             #ots stamp "$path_src";
         else