home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sgi:12628 comp.sys.mips:890 comp.unix.misc:3292 comp.unix.questions:10184
- Newsgroups: comp.sys.sgi,comp.sys.mips,comp.unix.misc,comp.unix.questions
- Path: sparky!uunet!morrow.stanford.edu!leland.Stanford.EDU!underdog
- From: underdog@leland.Stanford.EDU (Dwight Joe)
- Subject: Summary of (Re: Grep-ing for Constants (Re: Assembler Syntax...))
- Message-ID: <1992Aug19.235443.21099@leland.Stanford.EDU>
- Keywords: recap of "EXPORT", grep, UTLB exception handler
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: Miners for a Heart of Gold
- References: <1992Aug18.060851.11721@leland.Stanford.EDU>
- Date: Wed, 19 Aug 92 23:54:43 GMT
- Lines: 45
-
- In article <1992Aug18.060851.11721@leland.Stanford.EDU>
- underdog@leland.Stanford.EDU (Dwight Joe) writes:
- >... In the handler, there are some constants
- >which have symbolic labels that are defined else. For example,
- >consider the following:
- > #define VALUE_1 8888
- >In the past, when I needed to locate the actual value of a symbolic label
- >like VALUE_1, I could just do "grep VALUE_1 *.*", which would search
- >all files at my current level of the directory for a match with "VALUE_1".
- >Then, usually, the line "#define VALUE_1 8888" would appear.
- >Unfortunately, the code for the OS is distributed across multiple
- >directories. Is there a way to use grep (or some other command)
- >to do the search across all files at my current level of the directory
- >_and_ subdirectories below the current level--all at once?
- >It is also important that the path name of the file with a match
- >appear so that I can find the file producing the match.
- >Please respond by e-mail. I will produce a summary of any replies that I
- >receive.
-
- I received numerous replies.
-
- The one with the simplest explanation was
-
- Try:
- find . -exec grep your_string {} \; -print | pg
-
- I've tried it, and it works. Most of the other replies had
- variations on combining "find" and "grep".
-
- The only trouble with the suggestions is that they don't filter
- files for ones in which I do not want to search for a string.
- For example, obviously, I don't want to search in an executable
- file.
-
- Is there a way to specify "search everything _but_ object files
- and executable files"?
-
-
-
- -------------------------------------------------------------------------------
- Seikatsu no imi wa nan desu ka. \| |` | Don't buy from Toyota;
- Shitte itara oshiete kuremasen ka. | -+- | especially, don't buy
- /| / \ | from Capitol Toyota in
- Copyright 1992. | San Jose, California.
- -------------------------------------------------------------------------------
-