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