Path: utzoo!utgpu!watmath!watcgl!idallen From: idallen@watcgl.waterloo.edu Newsgroups: uw.mfcf.people Subject: selective use of absolute on $path Message-ID: <11257@watcgl.waterloo.edu> Date: 25 Aug 89 06:07:34 GMT Sender: idallen@watcgl.waterloo.edu Reply-To: idallen@watcgl.waterloo.edu Distribution: uw Lines: 66 From: "Ian! D. Allen [CGL]" % set path=( "`absolute $path:q`" ) The above works nicely provided you don't have "." in your path. (Provided you don't have *any* relative paths in your path, that is.) I've added it to the CGL standard login scripts. It shortens most command look-ups considerably. Using the distributed searchpath/showpath file is awful: cgl% showpath standard /software/.admin/bins/bin:/usr/ucb:/bin:/usr/bin cgl% absolute -v /software/.admin/bins/bin/lc /software/.admin/bins/bin/lc ^^^^^^^^ vvvvvvvvvvv /p3/software/.admin/bins/bin/lc ^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvv /.software/local/.admin/bins/bin/lc ^^^^^ vvvvvvvvvvvvvvvvv /usr/var/software/.admin/bins/bin/lc ^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv /usr/archware/mfcf-misc/bin/lc /usr/archware/mfcf-misc/bin/lc Applying absolute to the $path reduces this to just the last symlink. In fact, shouldn't the showpath data files have /.software/local/.admin/bins/bin (the local file name) in them instead of the /software rooted path? That would get rid of two symlink look-ups even without using absolute. It would be nice if showpath had an option to apply the absolute() function to absolute pathnames, delete duplicates, and leave the relative paths alone. I'd use it on main machines that weren't dependent on /NFS/. As it is, parsing $path and weeding out relative paths so that I can use absolute on the absolute paths is very slow. Here's an alias I find very useful in tracing paths to commands: alias atr 'absolute -v `showpath findall=!^ sep=" "`' as in cgl% atr searchpath /usr/var/software/.admin/bins/bin/searchpath ^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv /usr/archware/mfcf-basics/bin/searchpath /usr/archware/mfcf-basics/bin/searchpath /bin/searchpath ^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv /bin/../../../../software/mfcf-basics/bin/searchpath ^^^^^^^^ vvvvvvvvvvv /bin/../../../../p3/software/mfcf-basics/bin/searchpath ^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv /.software/arch/mfcf-basics/bin/searchpath ^^^^ vvvvvvvvvvvvv /usr/archware/mfcf-basics/bin/searchpath /usr/archware/mfcf-basics/bin/searchpath