#!/bin/bash # iterating line-by-line over the input file numOfPeople=`cat $1 | grep "$2" | wc -l` echo "Num. of people from $2 is $numOfPeople"