Is there a smart pwd display program?

J.B. Nicholson jbn35564 at uxa.cso.uiuc.edu
Tue Apr 16 03:09:10 AEST 1991


I'm writing a function for KSH that shows you your current working directory
using tilde notation:

What you type:                    What you get from the function:
---------------------------------------------------------------------------
cd                                ~/
cd ~joeuser                       ~joeuser
cd /home/dir/of/joeuser           ~joeuser
cd ..                             /home/dir/of
cd /                              /
cd /home/dir/of/me/1/2/3          ~/1/2/3

So you get the idea.  It runs pretty fast, but I was wondering if there's a
program (written in some compiled language, or maybe even Perl or something)
that'll give you the same thing, that would probably be better to run than
my function because it would be faster.

I'm currently trying to add some stuff that'll make it seem faster and trying
to use only the quickest way of addressing things like if-then's and so
forth (I posted a note about this before).  I'll be glad to share my
function once I've finished it.

Thanks.

Jeff
--
+----------------------------------------------------------------------------+
| "If you hear an onion ring - answer it."                    J.B. Nicholson |
+----------------------------------------------------------------------------+
| jeffo at uiuc.edu (Internet)              These opinions are mine, that's all.|
+----------------------------------------------------------------------------+



More information about the Comp.unix.shell mailing list