- for key in "${!list_copy[@]}"; do
- value="${list_copy[$key]}";
- ## Get basename of path
- file_basename="$(basename "$key")";
-
- ## Get 16-character b2sum fingerprint (for different files that share basename)
- fingerprint="$(b2sum -l64 "$key" | cut -d' ' -f1)";
-
- ## Form output filename
- file_name="$fingerprint".."$file_basename";
+ while read -r line; do
+ yell "DEBUG:line:$line"; # debug
+ fdur="$(printf "%s" "$line" | cut -d',' -f1)";
+ fsize="$(printf "%s" "$line" | cut -d',' -f2)";
+ fpath="$(printf "%s" "$line" | cut -d',' -f3-)";
+ ## Get basename of path
+ file_basename="$(basename "$fpath")";
+
+ ## Get 16-character b2sum fingerprint (for different files that share basename)
+ fingerprint="$(b2sum -l32 "$fpath" | awk '{print $1}' )";
+
+ ## Form output filename
+ num="$(printf "$num_fmt" "$n")";
+ file_name="$num"_"$fingerprint".."$file_basename";