How to find the definition of a string in /usr/include ?

Patrick O'Callaghan pocallaghan at gmail.com
Sun Nov 4 04:44:20 UTC 2012


On Sat, 2012-11-03 at 20:38 -0600, reg at dwf.com wrote:
> How do I find the definition of a string in /usr/include?
> 
> OK, there has got to be a better way to do this than with find and
> grep (which isnt working).

What do you mean they aren't working?

> BUT how does one find the definition
> of a string in /usr/include ???
> 
> In particular, I KNOW that month is defined SOMEWHERE, but Im
> not finding in in the obvious (to me) places. 
> 
> So how do I find 'Mo' or perhaps better yet 'Mo[' in /usr incude?

So which is it? month? MO? Mo[?

This finds definitions that include "month" (case-independently),
provided that the word is on the same line as the #define:

find /usr/include -type f|xargs grep -i "#[[:space:]]*define.*month"

poc



More information about the users mailing list