[print_image_id] Removed dependency on dc for calulating sum of bytes

This commit is contained in:
ayakael 2019-02-13 13:15:15 -05:00
parent 04e079222f
commit 7d70b136b4
No known key found for this signature in database
GPG key ID: DF4ED0DE242BD38A

View file

@ -16,5 +16,5 @@ print_imageid_du() {
[[ -z "${imageidList[@]}" ]] && { echo 0; return 0; }
local bytesList=($(awk 'BEGIN{RS=",";FS=":"}{if($1=="\"size\""){print $2}}' <<<$(git -C "${GIT_DIR}" annex info --bytes --json $(printf "%s.flac\t" ${imageidList[@]}))))
[[ -z "${bytesList[@]}" ]] && { echo 0; return 0; }
dc <<< '[+]sa[z2!>az2!>b]sb'"$(sed 's/"//g' <<< "${bytesList[@]}")lbxp"
printf '%s\n' ${bytesList[@]} | awk '{s+=$1} END {print s}'
}