#!/bin/bash file="$1" designs=$(sed -n '1s/, /|/gp' <"$file") echo $designs sed -e '1,2d' <"$file" | grep -E "^($designs)*$" | wc -l