grep -q "matching string here" < <(head -n 50 "$1") is a somewhat convoluted, non-portable (almost-)equivalent of head -n 50 "$1" | grep -q "matching string here". The latter syntax is straightforward and portable; it does not require bash, will work with sh -c.