projects
/
BK-2020-03.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat(u/bkfeh):Accept sample dir size and file count via envvar
[BK-2020-03.git]
/
user
/
bk-copy-rand-music.sh
diff --git
a/user/bk-copy-rand-music.sh
b/user/bk-copy-rand-music.sh
index c4e568594aa42eccdaf3a03489376028a9f6208c..ea384fe722371fa1d27ca488313e51801fb4fcc4 100755
(executable)
--- a/
user/bk-copy-rand-music.sh
+++ b/
user/bk-copy-rand-music.sh
@@
-1,7
+1,7
@@
#!/usr/bin/env bash
# Desc: Copies random audio files
# Usage: bk-copy-rand-music.sh [dir SOURCE] [dir DEST] [int DURATION]
#!/usr/bin/env bash
# Desc: Copies random audio files
# Usage: bk-copy-rand-music.sh [dir SOURCE] [dir DEST] [int DURATION]
-# Version: 0.0.
2
+# Version: 0.0.
3
declare -Ag appRollCall # Associative array for storing app status
declare -Ag fileRollCall # Associative array for storing file status
declare -Ag appRollCall # Associative array for storing app status
declare -Ag fileRollCall # Associative array for storing file status
@@
-452,6
+452,7
@@
main() {
if [[ $n -gt $max_loops ]]; then die "ERROR:Too many loops:$n"; fi;
done;
if [[ $n -gt $max_loops ]]; then die "ERROR:Too many loops:$n"; fi;
done;
+ n=0; # Initialize loop counter
# Copy files in list_copy to dir_dest;
for key in "${!list_copy[@]}"; do
value="${list_copy[$key]}";
# Copy files in list_copy to dir_dest;
for key in "${!list_copy[@]}"; do
value="${list_copy[$key]}";
@@
-472,6
+473,15
@@
main() {
try cp "$key" "$path_output" && yell "NOTICE:Copied ($value seconds): $key ";
#yell "DEBUG:Copied $file_basename to $dur_dest.";
try cp "$key" "$path_output" && yell "NOTICE:Copied ($value seconds): $key ";
#yell "DEBUG:Copied $file_basename to $dur_dest.";
+ ## Append log
+ path_log_output="$dir_dest"/COPY.log;
+ if [[ $n -le 0 ]]; then
+ echo "fingerprint","duration","original_path" >> "$path_log_output";
+ else
+ echo "$fingerprint","$value","$key" >> "$path_log_output";
+ fi;
+
+ ((n++));
unset file_basename path_output
done;
unset file_basename path_output
done;