home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / jed098-4.zip / JED / DOC / RGREP.TXT < prev    next >
Text File  |  1997-02-01  |  1KB  |  39 lines

  1. This file documents rgrep, a recursive, highlighting grep program.
  2.  
  3. Currently, rgrep is only available on Unix systems.  To build it, move to
  4. the src directory for JED and enter: `make rgrep'.
  5.  
  6. Why use rgrep instead of more traditional Unix tools?
  7. ------------------------------------------------------
  8.  
  9. Unlike grep and egrep, rgrep has the ability to recursively descend
  10. directories. The traditional way of performing this kind of search on Unix
  11. systems utilizes the `find' command in conjunction with `grep'.  However,
  12. this results in very poor performance.  Consider the tradional approach
  13. where one wants to search the /usr/include directory for the string `FD_SET':
  14. For this, one would use:
  15.  
  16. % find /usr/include -exec grep -l FD_SET \{\} \; -print
  17.  
  18. Ignoring the fact that the above expression looks complex, it failed to find
  19. any occurence of FD_SET under the /usr/include directory of my Ultrix
  20. system.  
  21.  
  22. Now, if rgrep is used, one types:
  23.  
  24. % rgrep -lFr FD_SET /usr/include
  25.  
  26. which yielded: /usr/include/sys/types.h
  27.  
  28. The reason that `find' failed is that /usr/include/sys is a symbolic link to
  29. /sys/h.  `rgrep' was able to succeed because of the `-F' flag which telles
  30. it to follow links.  I looked in the man page for a similar option for
  31. `find' but nothing turned up.
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.