#!/bin/bash # Function to check attachments in a file check_attachments() { local file="$1" # Use mkvinfo to get the details of the file, specifically looking for 'attachments' if ! mkvmerge -i "$file" | grep -q "Attachment"; then # If there are no attachments, print the filename echo "$file" fi } # Export the function so it can be used with find export -f check_attachments # Recursively find all .mkv files and check for attachments find . -type f -name "*.mkv" -exec bash -c 'check_attachments "$0"' {} \;