I often find myself grepping source code for a variable name and many times the name would be present in comment lines that I 'd prefer not to see. Do you guys know any tricks to filter out comments?
Example:
snippet of the source code
/***
* type comment 1
***/
void type_func(int rate)
{
int vrate = rate < 0 ? rate / (-2) : rate * (+2);
type = BIN_RATE + vrate; // current Bin type
bshx = MAX_TYPE + vrate;
// no type available
if(!type)
return;
plain grep results
$ grep type c.c
* type comment 1
void type_func(int rate)
type = BIN_RATE + vrate; // current Bin type
// no type available
if(!type)
I'd like to be able to see only this:
void type_func(int rate)
type = BIN_RATE + vrate; // current Bin type
if(!type)