I'm currently writing a script to examine /var/log/secure file and report how many failed attempts there were that day. I need to output it in the following format:
Date: 03/15/10 Time: 10:30 Number of failed attempts: 8
Heres my code so far (Haven't done much)... Am I on the right track?
#!/bin/bash
classGID=5000
passfile=/var/log/secure
for i in $(grep ${classGID} ${passfile} | cut -d: -f1)
do
date=$(grep $i{passfile} | cut -d: -f2)
echo "Date: ${date}"
done