1

Grep challenge!

view story
linux-howto

http://www.linuxquestions.org – Hello all! I'm trying to put together a grep command that will search a file (audit.log) for USERNAME=n where n is an unknown string and DATETIME=n n where both n's represent two 3-character values (day and month). Here's what I have so far: Code: grep -ow  "USERNAME=\w\{1,13\}\|DATETIME=\w\{1,3\}" audit.log* > test And the output looks like this: Code: audit.log:USERNAME=USTRELA audit.log:DATETIME=Wed Obviously I'm getting the day, but the 3-character month (eg Jan, Feb, etc.) should be included to look something like this: Code: audit.log:USERNAME=USTRELA audit (HowTos)