Skip to main content
2 of 2
added 1 character in body

I propose this alternative:

match="$(grep -vEx '[A-Z]{7}[[:space:]]+[A-Z]{3}' "$1")"
[[ "${#match}" -ne 0 ]] && printf "%b\n" "Bad lines:\n${match[@]}"
Bad lines:
FDFHDK JKL
1545665 152
867HDKE WER


Note from @they's answer:

The regular expression has been corrected to delete the extra + after {7}