4 declare -Ag appRollCall
# Associative array for storing app status
5 declare -Ag fileRollCall
# Associative array for storing file status
6 declare -Ag dirRollCall
# Associative array for storing dir status
7 declare -ag arrayPosArgs
# Associative array for processArgs() function
8 declare -g ots_delay
; ots_delay
=1 # minimum time in seconds between ots operations
10 calendars
+=("https://finney.calendar.eternitywall.com");
11 calendars
+=("https://btc.calendar.catallaxy.com");
12 calendars
+=("https://alice.btc.calendar.opentimestamps.org");
13 calendars
+=("https://bob.btc.calendar.opentimestamps.org");
14 age_threshold
="60"; # min age to add file; seconds;
17 yell
() { echo "$0: $*" >&2; } # print script path and all args to stderr
18 die
() { yell
"$*"; exit 111; } # same as yell() but non-zero exit status
19 try
() { "$@" || die
"cannot $*"; } # runs args as command, reports args if command fails
21 # Desc: If arg is a command, save result in assoc array 'appRollCall'
22 # Usage: checkapp arg1 arg2 arg3 ...
24 # Input: global assoc. array 'appRollCall'
25 # Output: adds/updates key(value) to global assoc array 'appRollCall'
31 if command -v "$arg" 1>/dev
/null
2>&1; then # Check if arg is a valid command
32 appRollCall
[$arg]="true";
33 if ! [ "$returnState" = "false" ]; then returnState
="true"; fi;
35 appRollCall
[$arg]="false"; returnState
="false";
39 #===Determine function return code===
40 if [ "$returnState" = "true" ]; then
45 } # Check that app exists
47 # Desc: If arg is a file path, save result in assoc array 'fileRollCall'
48 # Usage: checkfile arg1 arg2 arg3 ...
50 # Input: global assoc. array 'fileRollCall'
51 # Output: adds/updates key(value) to global assoc array 'fileRollCall';
52 # Output: returns 0 if app found, 1 otherwise
58 if [ -f "$arg" ]; then
59 fileRollCall
["$arg"]="true";
60 if ! [ "$returnState" = "false" ]; then returnState
="true"; fi;
62 fileRollCall
["$arg"]="false"; returnState
="false";
66 #===Determine function return code===
67 if [ "$returnState" = "true" ]; then
72 } # Check that file exists
74 # Desc: If arg is a dir path, save result in assoc array 'dirRollCall'
75 # Usage: checkdir arg1 arg2 arg3 ...
77 # Input: global assoc. array 'dirRollCall'
78 # Output: adds/updates key(value) to global assoc array 'dirRollCall';
79 # Output: returns 0 if all args are dirs; 1 otherwise
85 if [ -z "$arg" ]; then
86 dirRollCall
["(Unspecified Dirname(s))"]="false"; returnState
="false";
87 elif [ -d "$arg" ]; then
88 dirRollCall
["$arg"]="true";
89 if ! [ "$returnState" = "false" ]; then returnState
="true"; fi
91 dirRollCall
["$arg"]="false"; returnState
="false";
95 #===Determine function return code===
96 if [ "$returnState" = "true" ]; then
101 } # Check that dir exists
103 # Desc: Displays missing apps, files, and dirs
104 # Usage: displayMissing
106 # Input: associative arrays: appRollCall, fileRollCall, dirRollCall
107 # Output: stderr: messages indicating missing apps, file, or dirs
108 # Output: returns exit code 0 if nothing missing; 1 otherwise
109 # Depends: bash 5, checkAppFileDir()
110 local missingApps value appMissing missingFiles fileMissing
111 local missingDirs dirMissing
113 #==BEGIN Display errors==
114 #===BEGIN Display Missing Apps===
115 missingApps
="Missing apps :";
116 #for key in "${!appRollCall[@]}"; do echo "DEBUG:$key => ${appRollCall[$key]}"; done
117 for key
in "${!appRollCall[@]}"; do
118 value
="${appRollCall[$key]}";
119 if [ "$value" = "false" ]; then
120 #echo "DEBUG:Missing apps: $key => $value";
121 missingApps
="$missingApps""$key ";
125 if [ "$appMissing" = "true" ]; then # Only indicate if an app is missing.
126 echo "$missingApps" 1>&2;
129 #===END Display Missing Apps===
131 #===BEGIN Display Missing Files===
132 missingFiles
="Missing files:";
133 #for key in "${!fileRollCall[@]}"; do echo "DEBUG:$key => ${fileRollCall[$key]}"; done
134 for key
in "${!fileRollCall[@]}"; do
135 value
="${fileRollCall[$key]}";
136 if [ "$value" = "false" ]; then
137 #echo "DEBUG:Missing files: $key => $value";
138 missingFiles
="$missingFiles""$key ";
142 if [ "$fileMissing" = "true" ]; then # Only indicate if an app is missing.
143 echo "$missingFiles" 1>&2;
146 #===END Display Missing Files===
148 #===BEGIN Display Missing Directories===
149 missingDirs
="Missing dirs:";
150 #for key in "${!dirRollCall[@]}"; do echo "DEBUG:$key => ${dirRollCall[$key]}"; done
151 for key
in "${!dirRollCall[@]}"; do
152 value
="${dirRollCall[$key]}";
153 if [ "$value" = "false" ]; then
154 #echo "DEBUG:Missing dirs: $key => $value";
155 missingDirs
="$missingDirs""$key ";
159 if [ "$dirMissing" = "true" ]; then # Only indicate if an dir is missing.
160 echo "$missingDirs" 1>&2;
163 #===END Display Missing Directories===
165 #==END Display errors==
166 #==BEGIN Determine function return code===
167 if [ "$appMissing" == "true" ] ||
[ "$fileMissing" == "true" ] ||
[ "$dirMissing" == "true" ]; then
172 #==END Determine function return code===
173 } # Display missing apps, files, dirs
175 # Description: Prints verbose message ("vbm") to stderr if opVerbose is set to "true".
176 # Usage: vbm "DEBUG :verbose message here"
178 # Input: arg1: string
181 # Depends: bash 5.0.3, GNU-coreutils 8.30 (echo, date)
183 if [ "$opVerbose" = "true" ]; then
184 functionTime
="$(date --iso-8601=ns)"; # Save current time in nano seconds.
185 echo "[$functionTime]:$0:""$*" 1>&2; # Display argument text.
189 return 0; # Function finished.
190 } # Displays message if opVerbose true
192 # Desc: Displays script version and license information.
195 # Input: scriptVersion var containing version string
197 # Depends: vbm(), yell, GNU-coreutils 8.30
199 # Initialize function
200 vbm
"DEBUG:showVersion function called."
204 Copyright (C) 2022 Steven Baltakatei Sandoval
205 License GPLv3: GNU GPL version 3
206 This is free software; you are free to change and redistribute it.
207 There is NO WARRANTY, to the extent permitted by law.
210 Copyright (C) 2020 Free Software Foundation, Inc.
211 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
212 This is free software: you are free to change and redistribute it.
213 There is NO WARRANTY, to the extent permitted by law.
217 vbm
"DEBUG:showVersion function ended."
218 return 0; # Function finished.
219 } # Display script version.
221 # Desc: Display script usage information
226 # Depends: GNU-coreutils 8.30 (cat)
229 bkots [ options ] [PATH...]
231 POSITIONAL ARGUMENTS:
232 PATH Path(s) of file(s) or directory(ies)
236 Do everything except run 'ots' commands.
238 Display help information.
240 Include files and directories starting with '.' (not
241 included by default).
243 Consider files in dirs recursively.
245 Display script version.
247 Display debugging info.
249 Mark end of options. Interpret remaining arguments as
250 positional arguments.
253 Scans files by file paths or directory paths provided by
254 positional arguments to see if Open Timestamps '.ots' file
255 exists. If so, attempt to upgrade and verify the '.ots'
256 file. If no '.ots' file exists, attempt to create one.
258 Files with a dotfile parent directory located anywhere in the
259 file path are ignored by default. (e.g. 'HEAD' in
260 '/home/user/diary/.git/logs/HEAD' because of '.git'). Dotfiles
261 themselves are also ignored by default
262 (e.g. '/home/user/.gitconfig').
264 Files modified less than 1 minute ago are ignored.
268 bkots foo.txt bar.pdf /home/username/Pictures/
270 } # Display information on how to use this script.
272 # Desc: Processes arguments provided to script.
273 # Usage: processArgs "$@"
275 # Input: "$@" (list of arguments provided to the function)
276 # Output: Sets following variables used by other functions:
277 # opVerbose Indicates verbose mode enable status. (ex: "true", "false")
278 # arrayPosArgs Array of remaining positional argments
280 # yell() Displays messages to stderr.
281 # vbm() Displays messsages to stderr if opVerbose set to "true".
282 # showUsage() Displays usage information about parent script.
283 # showVersion() Displays version about parent script.
284 # arrayPosArgs Global array for storing non-option positional arguments (i.e. arguments following the `--` option).
285 # External dependencies: bash (5.1.16), echo
287 # [1]: Marco Aurelio (2014-05-08). "echo that outputs to stderr". https://stackoverflow.com/a/23550347
288 # [2]: "Handling positional parameters" (2018-05-12). https://wiki.bash-hackers.org/scripting/posparams
290 # Initialize function
291 vbm
"DEBUG:processArgs function called."
294 while [ ! $# -eq 0 ]; do # While number of arguments ($#) is not (!) equal to (-eq) zero (0).
295 #yell "DEBUG:Starting processArgs while loop." # Debug stderr message. See [1].
296 #yell "DEBUG:Provided arguments are:""$*" # Debug stderr message. See [1].
298 --dry-run) # Do not run ots commands
299 option_dry_run
="true";
300 vbm
"DEBUG:Option enabled:dry run";;
301 -h |
--help) showUsage
; exit 1;; # Display usage.
302 --include-dotfiles) # Include dotfiles
303 option_include_dotfiles
="true";
304 vbm
"DEBUG:Option enabled:include dotfiles";;
305 -r |
--recursive) # Specify recursive option
306 option_recursive
="true";
307 vbm
"DEBUG:option enabled:include files in dirs recursively";;
308 --version) showVersion
; exit 1;; # Show version
309 -v |
--verbose) opVerbose
="true"; vbm
"DEBUG:Verbose mode enabled.";; # Enable verbose mode. See [1].
310 --) # End of all options. See [2].
313 vbm
"DEBUG:adding to arrayPosArgs:$arg";
314 arrayPosArgs
+=("$arg");
317 -*) showUsage
; yell
"ERROR: Unrecognized option."; exit 1;; # Display usage
318 *) # Assume remaining arguments are positional arguments
320 vbm
"DEBUG:adding to arrayPosArgs:$arg";
321 arrayPosArgs
+=("$arg");
324 #*) showUsage; yell "ERROR: Unrecognized argument."; exit 1;; # Handle unrecognized options. See [1].
330 vbm
"DEBUG:processArgs function ended."
331 return 0; # Function finished.
332 }; # Evaluate script options from positional arguments (ex: $1, $2, $3, etc.).
333 get_parent_dirnames
() {
334 # Desc: Provides newline-delimited list of each parent dir of a file or dir
335 # Usage: get_parent_dirnames arg1
336 # Input: arg1 input path
337 # Output: stdout newline-delimited list of parent dirs
339 # Depends: yell(), die(), try()
343 if [[ $# -ne 1 ]]; then die
"FATAL:Incorrect number of arguments:$#"; fi;
344 if ! { [[ -f $1 ]] ||
[[ -d $1 ]]; }; then die
"FATAL:Not a file or dir:$1"; fi;
348 while [[ -f $path ]] ||
[[ -d $path ]]; do
349 path
="$(dirname "$path")";
350 name_base_previous
="$name_base";
351 name_base
="$(basename "$path")";
352 ## Check for stop condition (dirname returns same result as previous iteration)
353 if [[ $name_base == "$name_base_previous" ]]; then break; fi;
356 }; # Output parent dirnames to stdout
358 # Desc: Creates `.ots` file:
359 # - for each file specified in arrayPosArgs array
360 # - for each file in each dir specified in arrayPosArgs array
361 # Output file created alongside each file or in output directory specified by pathDirIn1
363 # Input: arrayPosArgs array with positional arguments
364 # pathDirOut1 path for output `.ots` files (if pathDirOut1 is specified and is a path)
365 # age_threshold var: mininum age in seconds to timestamp file
367 # Output: file(s) creates `.ots` file alongside specified files
368 # Depends: find (GNU findutils) 4.8.0, GNU Coreutils 8.32 (sort)
369 # Ref/Attrib: [1] How to create an array of unique elements from a string/array in bash https://unix.stackexchange.com/a/167194
370 # [2] How to find files containing newlines in their names https://stackoverflow.com/a/21727028
371 # [3] Get mtime of specific file using Bash? https://stackoverflow.com/a/4774377
372 local -a file_list file_list_pruned
;
373 local -a files_to_verify files_to_upgrade files_to_stamp
374 local -a files_to_verify_pruned files_to_upgrade_pruned files_to_stamp_pruned
380 if ! checkapp ots
find; then
382 die
"FATAL:Missing dependencies.";
386 for arg
in "${arrayPosArgs[@]}"; do
387 arg
="$(readlink -f "$arg")";
388 if ! { [[ -d $arg ]] ||
[[ -f $arg ]]; }; then
389 die
"FATAL:Not a file or dir:arg:$arg";
393 # Display ots details
394 vbm
"$(type ots)"; # show how 'ots' is defined
395 #TODO: add option to define 'ots' as a bash function that
396 #populates the ots option '--bitcoin-node FILE' with a
397 #user-specified FILE.
400 vbm
"DEBUG:begin populate file_list array";
401 for item
in "${arrayPosArgs[@]}"; do
402 vbm
"DEBUG:adding to file list:item:$item";
404 ## Get full canonicalized path (follow symlinks)
405 item
="$(readlink -f "$item")";
406 vbm
"DEBUG:item full path:item:$item";
408 ## Add to list: files
409 if [[ -f $item ]]; then
410 vbm
"DEBUG:is a file:item:$item";
411 file_list
+=("$item");
412 vbm
"DEBUG:added to file_list:$item";
413 ## Add to list: files in dirs
414 elif [[ -d $item ]]; then
415 vbm
"DEBUG:is a dir:item:$item";
416 ### Check for recursive flag
417 if [[ "$option_recursive" == "true" ]]; then
418 vbm
"DEBUG:option_recursive:$option_recursive";
419 while read -r line
; do
420 file_list
+=("$line");
421 vbm
"DEBUG:added to file_list:$line";
422 done < <(find "$item" -type f
);
424 while read -r line
; do
425 file_list
+=("$line");
426 vbm
"DEBUG:added to file_list:$line";
427 done < <(find "$item" -maxdepth 1 -type f
);
430 die
"FATAL:Not a file or dir:item:$item";
433 if [[ $opVerbose == "true" ]]; then
434 vbm
"DEBUG:file_list:";
435 printf "%s\n" "${file_list[@]}";
439 for item
in "${file_list[@]}"; do
440 ## Ignore files that end in '.ots.bak'.
441 if [[ $item =~
'.ots.bak'$
]]; then
442 yell
"INFO :Skipping file ending in '.ots.bak':item:$item";
443 continue; # skip to next item
447 if ! [[ $option_include_dotfiles == "true" ]]; then
448 ### Ignore files located beneath a dotfile directory (e.g. '/home/my_repo/.git/config')
449 unset flag_contains_dotfile_parent
;
450 while read -r line
; do
451 #### Check line from output of get_parent_dirnames
453 if [[ $line =~
$pattern ]]; then
454 ##### line starts with '.'
455 vbm
"DEBUG:Dotfile parent detected. Not including in file_list_pruned:$item";
456 vbm
"DEBUG:Dotfile in path:item:$item";
457 vbm
"DEBUG:Dotfile parent:line:$line";
458 flag_contains_dotfile_parent
="true";
461 done < <(get_parent_dirnames
"$item");
462 if [[ $flag_contains_dotfile_parent == "true" ]]; then
463 unset flag_contains_dotfile_parent
;
464 continue; # skip to next item (i.e. don't add to file_list_pruned)
467 ### Ignore dotfiles themselves
468 item_basename
="$(basename "$item")";
470 if [[ $item_basename =~
$pattern ]]; then
471 vbm
"INFO :Skipping dotfile:item:$item";
472 continue; # skip to next item
476 ## Ignore files with newlines present in filename. See [2].
477 if [[ $item =~ $
'\n' ]]; then
478 yell
"INFO :Skipping file name with newline:$item";
479 continue; # skip to next item
482 ## Ignore files that end in '~'.
483 if [[ $item =~ ~$
]]; then
484 yell
"INFO :Skipping file ending in tilde:$item";
485 continue; # skip to next item
488 ## Ignore files modified less than age_threshold. See [3].
489 time_now
="$(date +%s)"; # epoch seconds
490 item_age
="$(stat -c %Y "$item")"; # age in seconds
491 if [[ $
(( time_now
- item_age
)) -lt "$age_threshold" ]]; then
492 yell
"INFO :Skipping file modified less than $age_threshold seconds ago:item:$item";
493 continue; # skip to next item
496 ## Add item to file_list_pruned
497 file_list_pruned
+=("$item");
499 if [[ $opVerbose == "true" ]]; then
500 vbm
"DEBUG:file_list_pruned:";
501 printf "%s\n" "${file_list_pruned[@]}";
504 # Decide what actions to take for items in file_list_pruned
505 for item
in "${file_list_pruned[@]}"; do
506 vbm
"DEBUG:considering action to take for item:$item";
507 unset path_src path_prf dir_parent dir_source
;
509 ## Check file extension
510 if [[ $item =~ .ots$
]]; then
511 ### item ends in '.ots'. Item is proof file.
512 vbm
"DEBUG:item ends in '.ots'. Item is proof file:item:$item";
513 if [[ -f ${item%.ots} ]]; then
514 #### Proof file (item) is adjacent to source file
515 vbm
"DEBUG:Proof file (item) is adjacent to source file.";
516 ##### Upgrade and verify proof file against adjacent source file
517 vbm
"DEBUG:Marking proof file to be upgraded and verified.";
518 path_src
="${item%.ots}";
520 files_to_upgrade
+=("$(printf "%s
" "$path_prf")");
521 files_to_verify
+=("$(printf "%s
\n%s
" "$path_src" "$path_prf")");
523 #### Proof file (item) is not adjacent to source file
524 vbm
"DEBUG:Proof file (item) is not adjacent to source file.";
525 #### Check if source file in parent dir
526 dir_parent
="$(dirname "$
(dirname "$item")" )";
527 cand_src_filename
="$(basename "$item")";
528 cand_src_path
="$dir_parent/$cand_src_filename";
529 if [[ -f "$cand_src_path" ]]; then
530 ##### source file in parent dir
531 vbm
"DEBUG:found source file in parent:cand_src_path:$cand_src_path";
532 path_src
="$cand_src_path";
534 files_to_upgrade
+=("$(printf "%s
" "$path_prf")");
535 files_to_verify
+=("$(printf "%s
\n%s
" "$path_src" "$path_prf")");
537 #### Throw non-fatal error
538 vbm
"DEBUG:Source file not found for proof file:item:$item";
539 yell
"ERROR:Item is proof file but source filei not adjacent in parent dir. item:$item";
540 #### Attempt upgrade only
541 vbm
"DEBUG:Marking proof file to be upgraded.";
543 files_to_upgrade
+=("$(printf "%s
" "$path_prf")");
547 ### item does not end in '.ots'. Item is source file.
548 vbm
"DEBUG:item does NOT end in '.ots'. Item is source file.";
549 if [[ -f "$item".ots
]]; then
550 #### Proof file is adjacent to source file (item).
551 vbm
"DEBUG:Proof file is adjacent to source file (item).";
552 ##### Upgrade and verify proof file against adjacent source file.
553 vbm
"DEBUG:Marking proof file to be upgraded and verified.";
555 path_prf
="$item.ots";
556 files_to_upgrade
+=("$(printf "%s
" "$path_prf")");
557 files_to_verify
+=("$(printf "%s
\n%s
" "$path_src" "$path_prf")");
559 #### Proof file is not adjacent to source file (item).
560 #### Check if proof file is in subdir
561 vbm
"DEBUG:checking if proof file for source file (item) is in subdir:item:$item";
562 unset flag_proof_in_subdir
;
563 dir_item
="$(dirname "$item")";
564 cand_prf_filename
="$(basename "$item")".ots
;
565 while read -r line
; do
566 line_basename
="$(basename "$line")";
567 if [[ $line_basename == "$cand_prf_filename" ]]; then
568 flag_proof_in_subdir
="true";
570 vbm
"DEBUG:proof found in subdir at:line:$line";
573 done < <(find "$dir_item" -mindepth 2 -maxdepth 2 -type f
)
574 if [[ $flag_proof_in_subdir == "true" ]]; then
575 ##### Proof file is in subdir
576 vbm
"DEBUG:Proof file detected in subdir relative to source file (item)";
577 #path_prf="$path_prf"; # set in while loop
579 files_to_upgrade
+=("$(printf "%s
" "$path_prf")");
580 files_to_verify
+=("$(printf "%s
\n%s
" "$path_src" "$path_prf")");
582 ##### Proof file is not in subdir
583 vbm
"DEBUG:Proof file not detected in subdir relative to source file (item).";
584 #### Stamp source file
585 vbm
"DEBUG:Marking source file to be stamped.";
587 files_to_stamp
+=("$(printf "%s
" "$path_src")")
589 unset flag_proof_in_subdir
;
593 unset path_src path_prf dir_item dir_parent cand_prf_filename cand_src_filename line_basename cand_src_path
595 # Prune action lists.
596 ## Sort and prune file action arrays
598 while read -r -d $
'\0' line
; do
599 vbm
"DEBUG:adding to files_to_upgrade_pruned:line:$line";
600 files_to_upgrade_pruned
+=("$line");
601 done < <(printf "%s\0" "${files_to_upgrade[@]}" |
sort -zu | shuf
-z); # See [1]
602 if [[ $opVerbose == "true" ]]; then
603 vbm
"DEBUG:files_to_upgrade_pruned:";
604 printf "%s\n" "${files_to_upgrade_pruned[@]}";
608 while read -r -d $
'\0' line
; do
609 vbm
"DEBUG:adding to files_to_verify_pruned:line:$line";
610 files_to_verify_pruned
+=("$line");
611 done < <(printf "%s\0" "${files_to_verify[@]}" |
sort -zu | shuf
-z); # See [1]
612 if [[ $opVerbose == "true" ]]; then
613 vbm
"DEBUG:files_to_verify_pruned:";
614 printf "%s\n\n" "${files_to_verify_pruned[@]}";
618 while read -r -d $
'\0' line
; do
619 vbm
"DEBUG:adding to files_to_stamp_pruned:line:$line";
620 files_to_stamp_pruned
+=("$line");
621 done < <(printf "%s\0" "${files_to_stamp[@]}" |
sort -zu | shuf
-z); # See [1]
622 if [[ $opVerbose == "true" ]]; then
623 vbm
"DEBUG:files_to_stamp_pruned:";
624 printf "%s\n" "${files_to_stamp_pruned[@]}";
629 for item
in "${files_to_upgrade_pruned[@]}"; do
630 path_prf
="$(cut -d $'\n' -f1 < <(echo "$item"))";
631 if [[ -z "$path_prf" ]]; then
632 yell
"ERROR:blank upgrade item encountered. Skipping:item:$item";
635 vbm
"DEBUG:Attempting to upgrade proof file:path_prf:$path_prf";
636 if [[ ! $option_dry_run == "true" ]]; then
637 ### Try upgrade with known calendars in random order
638 while read -r url
; do
639 vbm
"DEBUG:Upgrading with calendar:url:$url";
640 ots
-l "$url" --no-default-whitelist upgrade
"$path_prf" && break;
641 done < <(printf "%s\n" "${calendars[@]}" | shuf
);
643 yell
"DEBUG:DRY RUN:Not running:\"ots upgrade $path_prf\"";
649 for item
in "${files_to_verify_pruned[@]}"; do
650 path_src
="$(cut -d $'\n' -f1 < <(echo "$item"))";
651 path_prf
="$(cut -d $'\n' -f2 < <(echo "$item"))";
652 if [[ -z "$path_src" ]] ||
[[ -z "$path_prf" ]]; then
653 yell
"ERROR:blank verify item encountered. Skipping:item:$item";
656 vbm
"DEBUG:Attempting to verify source file:path_src:$path_src";
657 vbm
"DEBUG: against proof file: path_prf:$path_prf";
658 if [[ ! $option_dry_run == "true" ]]; then
659 ### Try verify with known calendars in random order
660 while read -r url
; do
661 vbm
"DEBUG:Verifying with calendar:url:$url";
662 ots
-l "$url" --no-default-whitelist verify
-f "$path_src" "$path_prf" && break;
663 done < <(printf "%s\n" "${calendars[@]}" | shuf
);
665 yell
"DEBUG:DRY RUN:Not running:\"ots verify -f $path_src $path_prf\"";
671 for item
in "${files_to_stamp_pruned[@]}"; do
672 path_src
="$(cut -d $'\n' -f1 < <(echo "$item"))";
673 if [[ -z "$path_src" ]]; then
674 yell
"ERROR:blank stamp item encountered. Skipping:item:$item";
677 vbm
"DEBUG:Attempting to stamp source file:path_src:$path_src";
678 if [[ ! $option_dry_run == "true" ]]; then
679 ots stamp
"$path_src";
681 yell
"DEBUG:DRY RUN:Not running:\"ots stamp $path_src\"";