ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am trying to analyze a source code package, and I am trying to find occurences of expression patterns e.g 'waitpid' in the entire source package. The pattern is not only a single expression but a large set of expressions, and naturally I have to store the list of patterns in the file.
The pattern file contains 100's of pattern expressions, one expression per line. I tried to use grep to find the pattern, but ,this was not effective. The output is nonsense.
grep -rn -f <pattern file> ./
There is an open source tool GNU Global, it generates html tags for an entire source package , and allows you to search for expressions from source files.
To search an occurence of the expression, the syntax is
global -xg 'pattern expression'
But the problem is that it supports only searching a single pattern.
I tried this trick
global -xg `cat <pattern file>`
But apparently dumping from cat is only effective if the pattern file contains only several lines of words. But for 100's of lines. This will not work!!! There is no output.
You could try this.