On Tue, Mar 30, 2021 at 7:43 PM Eric Cook <l...@gmx.com> wrote: > typeset -A tags=(); set -- > while IFS='|' read -ra ary; do > set -- "$@" "${ary[@]}" > done < <( > exiftool -j *.flac | > jq -r '.[]| {Artist, Track, Genre, Title}|to_entries[]| .key + "|" + > .value' > ) > eval 'tags=('"${*@Q}"\) > typeset -p tags > declare -A tags=([lofi]="Title" [Track]="Genre" [Artist]="AK420" ["A2 - > Northern Lights"]="" ) >
Why so much trouble for such a simple operation? $ declare -A tags $ readarray -d '' -t ary < <(exiftool -j 05\ -\ Ted.flac | jq -j '.[] | {Artist, Track, Genre, Title} | to_entries[] | [.key, .value, ""] | join("\u0000")') $ eval 'tags=(' "${ary[@]@Q}" ')' $ declare -p tags declare -A tags=([Title]="Ted" [Genre]="Electronica/Dance" [Track]="" [Artist]="Clark" )