I'm trying to search a substantial C++ codebase for a single line that is outputing text to the terminal that I'd like to suppress. I have grepped for
std::cout and have had around 40 different files returned. The problems I face are:
- I did not add this myself so I have no idea where it is.
- It is a pointer only outputing memory location so I have no context in which to search for it.
- The codebase is enourmous and contains a great many other instances of
sdt::coutthat have once been used for debugging purposes and have since been commented out.
My question pertains to the last one. I am using
grep -rle 'std::cout' .
to search, which will return positive for instances of
// std::cout and any other occurence of
std::cout sitting on a line that is actually commented out.
How can I modify my
grep to omit any line containing
// so I can eliminate the commented lines?