home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!milo.mcs.anl.gov!ibm.mcs.anl.gov!nickless
- From: nickless@ibm.mcs.anl.gov (Bill Nickless)
- Subject: Re: Using the Automounter
- Message-ID: <7140083348377@ibm.mcs.anl.gov>
- Sender: usenet@mcs.anl.gov
- Nntp-Posting-Host: ibm.mcs.anl.gov
- Organization: Argonne National Laboratory, Chicago, Illinois
- References: <4275@inca.comlab.ox.ac.uk>
- Date: Sun, 16 Aug 1992 23:38:54 GMT
- Lines: 66
-
- In article <4275@inca.comlab.ox.ac.uk> mjs@prg.ox.ac.uk (Michael Smith) writes:
- >Has anyone out there perfected use of this wonderful feature?
- >I have managed to set it up, but, for example, typing
- >cd /home/nmra and then pwd gives /tmp_mnt/home/nmra, which
- >is fine-ish, but makes things a bit more difficult to use.
- >Is there some way of setting it up so the look is the same
- >as with the ordinary mount?
-
- Two ways:
-
- 1) Live with it--having the /tmp_mnt in the beginning of the path shouldn't
- break too many things.
-
- 2) Use the following perl script as a replacement for pwd for the
- applications that thing they really need the absolute pathname. Hope it
- helps.
-
- #!/usr/local/bin/perl
- eval "exec /usr/local/bin/perl -S $0 $*" if $running_under_some_shell;
-
- $_ = `/bin/pwd`;
- chop;
-
- @thisdir = stat ($_);
- @thatdir = ();
-
- # Let's try and see if it's the /tmp_mnt thing:
- # The input would be like /tmp_mnt/Net/sparky/sparky3/henderso
-
- if (m#/tmp_mnt(.*)#) {
- @thatdir=stat($1);
- if ($thisdir[2] == $thatdir[2]) {
- print "$1\n";
- exit(1);
- }
- }
-
- # Or possibly, could it be from a NeXT automounter?
- # The input would be like /private/Net/sparky/sparky3/henderso
-
- if(m#/private(.*)#) {
- @thatdir=stat($1);
- if ($thisdir[2] == $thatdir[2]) {
- print "$1\n";
- exit(2);
- }
- }
-
- # Maybe we're on a DECstation!
- # The input would be like /tmp_mnt/Net/sparky/sparky3/sparky/henderso
-
- if(m#/tmp_mnt(/[^/]*/[^/]*/[^/]*)/[^/]*(.*)#) {
- $try=$1.$2;
- @thatdir=stat($try);
- if ($thisdir[2] == $thatdir[2]) {
- print "$try\n";
- exit(3);
- }
- }
-
- # Evidently it didn't match anything, but we've got to return something:
-
- print "$_\n";
- exit (0);
- ---
- Bill Nickless System Support Group <nickless@mcs.anl.gov> +1 708 252 7390
-