home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12628 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.6 KB

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