![]() |
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 |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 11:50 AM |
| problem with grep on search string in a txt file over multiple files | m00 | UNIX for Dummies Questions & Answers | 2 | 05-18-2008 02:21 PM |
| Need to search and replace in multiple files in directory hierarchy | umen | Shell Programming and Scripting | 3 | 12-24-2007 04:56 AM |
| Search for files in multiple directories | ravikirankethe | UNIX for Dummies Questions & Answers | 7 | 10-29-2006 05:29 PM |
| Searching multiple files with multiple expressions | Anahka | Shell Programming and Scripting | 6 | 01-07-2004 06:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Multiple search in multiple files
Hello,
I would like to perform a search of several different strings in different files. I have the ouput of a unix command X which is for instance: aaa bbb ccc and I would like to look for each of these three strings into several files: file1 file2 etc. I have come up with a solution that works... but slowly and not very neatly.. I am redirecting the output I get from command X to a file and then I read this file line by line performing the search with grep: Code:
[several commands] > tmpFile while read line do grep $line file1 file2 file3 >> finalFile done < tmpFile Thank you for any help Max |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|