for msg in dhcpd last named ntpd sshd syslogd do for i in 20 21 22 23 24 25 26 27 do echo "There were `grep " $msg" messages.1 | grep "Dec $i" | wc -l` $msg lines On Dec $i" done done