[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cd tracking symbolic links



| Gregory L. Snead wrote
| >   I'm curious of your reasons why this isn't the right thing to do.
| 
| Because then ``ls ..'' disagrees with ``cd ..; ls'' and I get confused
| by that.  Other people don't;  this hack's for them.

 Scott> Paul is right that asymmetry between shell and kernel is
 Scott> irritating.  I tend to blame ".." itself, which is a
 Scott> questionable feature when your filesystem isn't really a
 Scott> tree.  If you have symbolic links (or worse, union mounts
 Scott> or mounted streams) then ".." yields surprises all too
 Scott> often.  If chdir's semantics were to set a default prefix
 Scott> this wouldn't happen.  Enlightened systems like Sprite
 Scott> and QNX use prefix tables internally instead of mount
 Scott> points anyway, so there is precident for this, aside from
 Scott> VMS. :-)

Scott,

  If I understand you correctly, then I tend to use es this way.
For example, if I'm going to use a couple of directories on a
regular basis, I will assign them to a variable.  I will prepend
this variable to file I access.

  A sample session to first define a few things

   ; a=~something/dir1
   ; b=/disk2/product/sources
   ; c=/usr/local/lib/lisp
   ; fn d x y { diff $x $y | more }
   ; fn m x y { more $x $y }


  Then use them

   ; d $a/file1 $b/file2

  Using command line editing to change the "d" to an "m"

   ; ^p^a^dm
   ; m $a/file1 $b/file2


  I only do this when I need to perform the same operation
repeatedly during the life of a project.



  In the Unix paradigm, I guess this is what you're talking
about.  I haven't use VMS in a while (and I'm not familiar with
QNX or Sprite) would you provide an example of using prefix
tables?  (I know, this is off the original subject).


  -- gregoir