Comment Comment by piedar grep -o $pattern $filename | wc -l But yours has better error handling! parent piedar 4 years ago