Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Symbolic links and Bourne shell... Keywords: pwd, ls, ln -s Message-ID: <1990Sep7.172657.24950@iwarp.intel.com> Date: 7 Sep 90 17:26:57 GMT References: <19417@well.sf.ca.us> <1990Sep7.140159.4832@usenet.ins.cwru.edu> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 25 In-Reply-To: boysko@dsrgsun.CES.CWRU.Edu (Glenn Boysko) In article <1990Sep7.140159.4832@usenet.ins.cwru.edu>, boysko@dsrgsun (Glenn Boysko) writes: | In Bourne shell, how can you find the path pointed to be a symbolic link? | However, in Bourne shell, pwd returns the same value as SYMLINK. Does anyone | know how to get this info in a Bourne shell without typing: | | % linkpath="`csh -c 'cd $SYMLINK; pwd'`" I use /bin/pwd, as in: (cd /SOMEWHERE/THAT/MAY/BE/A/SYMLINK; /bin/pwd) which avoids any builtin pwd command (in either sh or csh) that may be fooled by the presence of symlinks. I also have a script (in Perl, natch) that expands symlinks step by step to tell me how "expensive" they are (we had a lot of off-machine symlinks that were pointing to other possibly on-machine directories that were causing a lot of net traffic). Just another Unix hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/