home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / shell / 4841 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.9 KB  |  52 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
  3. From: etxmesa@eos.ericsson.se (Michael Salmon)
  4. Subject: Re: Find and symbolic links
  5. Message-ID: <1992Nov23.095922.2099@ericsson.se>
  6. Sender: news@ericsson.se
  7. Nntp-Posting-Host: eos6c02.ericsson.se
  8. Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
  9. Organization: Ericsson Telecom AB
  10. References:  <1epg9qINNfb8@OPAL.SYSTEMSX.CS.YALE.EDU>
  11. Date: Mon, 23 Nov 1992 09:59:22 GMT
  12. Lines: 38
  13.  
  14. In article <1epg9qINNfb8@OPAL.SYSTEMSX.CS.YALE.EDU>, 
  15. A. Satish Pai <Pai-Satish@CS.Yale.Edu> writes:
  16. |> 
  17. |> Hi, everybody!
  18. |> 
  19. |> Is there any workaround/trick/hack/shell-script that can be used to use find in
  20. |> such a way that it follows symbolic links and descends down them recursively?
  21. |> 
  22. |> I find it annoying that find doesn't follow links. No doubt there are good
  23. |> reasons for making it operate that way but at least there should have been an
  24. |> option to override that, IMHO. Why do I want to follow links? Out here, the
  25. |> "real" directory structure is some hugely complicated thing that only the
  26. |> sysadmins worry about; what users normally see (such as /usr/bin, /homes, etc.)
  27. |> are almost all links to something else. I really don't want to run find with
  28. |> arguments that look like /u6/old/tmp-sys/usr.bin when what I'm thinking of
  29. |> is (say) /usr/bin. Naturally, if I just specify the names I want, find will
  30. |> skip entire directories because something at the top happens to be a sym link.
  31.  
  32. Under SunOS 4.1.1 the following works:
  33.  
  34.  eos6c02 tmp 102 > find /bin -name sh -print 
  35.  eos6c02 tmp 103 > find /bin/ -name sh -print
  36. /bin/sh
  37.  
  38. which sounds like it does at least part of what you want. Otherwise try
  39. perl, it has routines to emulate find that can follow symbolic links if
  40. you want.
  41.  
  42. -- 
  43.  
  44. Michael Salmon
  45.  
  46. #include    <standard.disclaimer>
  47. #include    <witty.saying>
  48. #include    <fancy.pseudo.graphics>
  49.  
  50. Ericsson Telecom AB
  51. Stockholm
  52.