![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to spool a unix file | kripssmart | Shell Programming and Scripting | 2 | 06-18-2008 04:35 AM |
| Can I delete the file var/spool/mail/news? | dennisheazle | UNIX for Dummies Questions & Answers | 3 | 04-08-2008 11:12 PM |
| code to FTP the spool file from Sqlplus to the unix server. | vprevin | Shell Programming and Scripting | 0 | 10-31-2007 02:48 AM |
| grep error | Dave724001 | UNIX for Dummies Questions & Answers | 2 | 11-07-2006 06:48 AM |
| Increase width of Spool file | handynas | UNIX for Dummies Questions & Answers | 2 | 11-20-2001 09:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
grep spool file error
Hi,
I am trying to do this For i in *.txt do sed 'some pattern checking' $i done >file These text files are spool files.And when i find error in these spool files I want to append the text file contents to error.log file. Or is there any option that I do this sed for only files that does not contain errors? Can some one tell me how can i do this please.. Last edited by ran16; 06-18-2008 at 08:44 AM.. |
|
||||
|
I don't think you need the sort | uniq because grep will only print each file name once. In any event, the purpose of cat is to concatenate multiple files, so you really don't need the loop either.
Code:
cat `grep -l 'pattern_to_check' *.txt` >>error.log |
|
||||
|
If I use like grep -v 'ERROR' *.txt then I get lines also from the text files which do not have ERROR pattern
I want to grep only files that do not have the pattern I even used 'grep -r exclude' option but some how syntax is wrong I think so. Please tell me the exact command |
![]() |
| Bookmarks |
| Tags |
| grep, sort |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|