Parsing multiple tags from BASH?

Started by theprof, October 25, 2024, 06:25:12 PM

Previous topic - Next topic

theprof

My environment is Debian Linux and I'm the default shell BASH for processing.
MIME_TYPE=$(exiftool -MimeType -s3 "$SOURCE_FILE")
COMPRESSOR_ID=$(exiftool -CompressorId -s3 "$SOURCE_FILE")
COVER_ART=$(exiftool -CoverArt -s3 "$SOURCE_FILE")

Is there a way to parse all 3 tags (MimeType, CompressorId, CoverArt) into the 3 separate variables WITHOUT using additional packages?

theprof

Found the answer:
arry=($(exiftool -MimeType -CompressorId -CoverArt -s3 "$SOURCE_FILE"))
MIME_TYPE="${arry[0]}"
COMPRESSOR_ID="${arry[1]}"
COVER_ART="${arry[2]}"