LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Regular Expressions (https://www.linuxquestions.org/questions/programming-9/regular-expressions-320378/)

markjuggles 05-05-2005 09:43 AM

Regular Expressions
 
Hi,

I would like to grep a source file for all 'malloc' and 'free' calls at the same time to track down a memory leak.

What is the best way to do this? I'm very rusty with Perl :(

Thanks,

Mark

jlliagre 05-05-2005 11:24 AM

Code:

egrep "(malloc|free)" source.c

markjuggles 05-05-2005 11:39 AM

Perfect!

Thank you


All times are GMT -5. The time now is 08:33 PM.