perl -ne '/pattern/?$test=1:{($test>=1)?$test++:next}&&($test>=2&&$test<=11)?print:next'