Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 1999 09:59:04 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Search a symbol in the source tree
Message-ID:  <19991012095904.A8849@dan.emsphone.com>
In-Reply-To: <Pine.GSO.3.96.991012102820.6979B-100000@sol.cs.binghamton.edu>
References:  <Pine.GSO.3.96.991012102820.6979B-100000@sol.cs.binghamton.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Oct 12), Zhihui Zhang said:
> Can anyone suggest me a way of searching symbols in the entire /usr/src
> tree? I normally use grep */*.  But grep does not work recursively, right? 
> Something like a small shell script may do this. Thanks a lot.

If you use zsh, it has a "recursive glob":

  grep draw_mouse **/*.c

You could also use find | xargs:

  find . -name "*.c" | xargs grep draw_mouse

Or you could use gtags/global:

  gtags
  global -gx "draw_mouse"

If you're really looking for the source file that defines a symbol,
global is the way to go.

-- 
	Dan Nelson
	dnelson@emsphone.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991012095904.A8849>