The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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
Grep question. saurabhsinha23 UNIX for Dummies Questions & Answers 3 12-11-2007 01:58 AM
grep question tim-bobby UNIX for Dummies Questions & Answers 4 10-05-2007 11:58 AM
Another grep question kingdbag UNIX for Dummies Questions & Answers 6 10-27-2006 01:56 AM
grep & sed question der Kopf Shell Programming and Scripting 1 11-22-2004 04:49 AM
Grep question eloquent99 UNIX for Dummies Questions & Answers 4 02-20-2003 10:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-22-2007
Adriel Adriel is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 20
Question about GREP

I have 2 files, in one file is a list of hex numbers, the other is what i need matched. Is it possible for me to specify to grep the list and have it go through the second file for each item in the list in the first file to match the lines? so this is like a cross-refference.
  #2 (permalink)  
Old 03-22-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
grep -f file_with_hex_list file_to_be_matched
  #3 (permalink)  
Old 03-22-2007
Adriel Adriel is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 20
wow, thank you for the fast reply - i was looing all over the internet for how to do that with no avail.
  #4 (permalink)  
Old 03-22-2007
Adriel Adriel is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 20
Quote:
Originally Posted by anbu23
Code:
grep -f file_with_hex_list file_to_be_matched

is that the exact command? say "hexlist" is the list file and "searchlist" is the search file, i typed:

Code:
grep -f hexlist searchlist > results
all it did was copy searchlist to results.
  #5 (permalink)  
Old 03-22-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
check out this link!
  #6 (permalink)  
Old 03-22-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Then all the lines in searchlist file should contain any one of hex numbers in hexlist file.
  #7 (permalink)  
Old 03-22-2007
Adriel Adriel is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 20
Quote:
Originally Posted by anbu23
Then all the lines in searchlist file should contain any one of hex numbers in hexlist file.
no - the whole file does not match the list.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0