#! /bin/bash count=$(cat mydates | awk -F'[:]' '$3 >= 30 && $3 <= 40 {c++} END{ print c }') echo $count