I would like a simple shell script that will allow me to display to screen all unsuccessful su attempts in my sulog file, for the present date.
I have been trying several different combinations of commands, but I can't quite get the syntax correct.
The mess I have right now (don't laugh) is this:
#!/bin/bash
DATE = `date " +%b %d"`
grep $DATE >/dev/null
if ($4 == "-"); then
printf
fi
You can see what I'm trying to accomplish here, but I'm stuck at this point. I tried reading to see if there was a way to use a complex grep or egrep command, but that was a little too complicated for me at this point.
I just would like a simple script that I could use over and over that will search the sulog and print to the screen any failed attempts for whatever the date is at the present time.
I tried playing around with the find command, but I can't figure out how to combine multiple criteria.
I want to find only files without a "+" in the 4th column of the row, such as: