[kwlug-disc] Building cross reference -- how?

William Park opengeometry at yahoo.ca
Sun Oct 13 02:14:04 EDT 2013


Hi all,

I want to build cross reference on certain lines in files.  I can
extract those lines into a file, say in format
    filename,...line...

Now, how do I build cross reference?

For example, if I have
    file1, one two three red
    file2, four five
    file3, red blue yellow
    file4, blue one
Then, cross reference for "red" should give me first line (file1) and
3rd line (file3).  And, cross reference for "red one" should give me
only the first line (file1).  I guess I can do
    fgrep -e red
    fgrep -e red | fgrep -e one

Is there a program, similar to "updatedb" and "slocate"?
-- 
William





More information about the kwlug-disc mailing list