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.
# 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
## 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;
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
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;
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
## 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;
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