![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ignore some lines with specific words from file comparison | jakSun8 | Shell Programming and Scripting | 2 | 03-13-2008 12:11 AM |
| Tar Exclude Dir with a Specific Words | rhartleyoh | UNIX for Dummies Questions & Answers | 1 | 07-26-2007 11:53 AM |
| Search files that all contain 4 specific words | WoodenSword | Shell Programming and Scripting | 13 | 01-22-2007 06:57 AM |
| Search and replace words between two keywords | vrrajeeb | Shell Programming and Scripting | 6 | 05-11-2005 01:15 PM |
| search for words in file | Agent_Orange | Shell Programming and Scripting | 4 | 10-25-2002 06:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Search File for Specific Words
I have a file that contains the following:
Mon Dec 3 15:52:57 PST 2o007: FAILED TO PROCESSED FILE 200712030790881200.TXT - exit code=107 Tue Dec 4 09:08:57 PST 2007: FAILED TO PROCESSED FILE 200712030790879200a.TXT - exit code=107 This file also has a lot more stuff since it is a log file. I am currently using the following but there must be a shorter way of doing it. Code:
LOGDIR=/path/to/log/directory grep FAILED $LOGDIR/processor.log | grep `date +20%y%m%d%y` | grep 107 > tempfile Code:
grep -E "FAILED[\w]*`date +20%y%m%d%y`[\w]*107 TIA Mike |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|