Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2002 16:20:37 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        "Tim J. Robbins" <tjr@FreeBSD.org>
Cc:        Brian Somers <brian@Awfulhak.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@Awfulhak.org
Subject:   Re: cvs commit: src/bin/pwd pwd.1 pwd.c 
Message-ID:  <200205181520.g4IFKbWs010806@hak.lan.Awfulhak.org>
In-Reply-To: Message from "Tim J. Robbins" <tjr@FreeBSD.org>  of "Sat, 18 May 2002 23:43:46 %2B1000." <20020518234346.A16088@treetop.robbins.dropbear.id.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sat, May 18, 2002 at 11:30:09AM +0100, Brian Somers wrote:
> 
> > > tjr         2002/05/17 19:47:25 PDT
> > > 
> > >   Modified files:
> > >     bin/pwd              pwd.1 pwd.c 
> > >   Log:
> > >   Make -L the default, allow both -L and -P to be specified (last one used
> > >   matters), fall back to -P mode if we can't get the logical directory.
> > >   
> > >   Revision  Changes    Path
> > >   1.19      +2 -2      src/bin/pwd/pwd.1
> > >   1.18      +14 -9     src/bin/pwd/pwd.c
> > 
> > I don't think this is wise.  I've always been of the understanding 
> > that ``pwd'' gives me my logical directory and ``/bin/pwd'' gives me 
> > the physical one.  I've written scripts to depend on this.
> 
> Ok, I will restore -P as the default for the moment. I understand that
> /bin/pwd has historically used getcwd() or similar, but I wasn't aware
> that anything would break if pwd gave the logical directory name by default.
> 
> What assumptions do the scripts make that would no longer work if -L
> was the default?

Well, the scripts just assume that /bin/pwd does a getcwd() -- 
looking at $PWD (which seems to be how -L is implemented) is 
something that the script can do to figure out the logical directory.

I can't remember exactly why the scripts needed the real directory - 
just that they wanted to know if [ "$PWD" != $(/bin/pwd) ].

Doesn't POSIX or one of the other standards mandate which one is 
presented by default ?  I'm happy to be overruled for a good reason.

> Tim

-- 
Brian <brian@Awfulhak.org>                    <brian@freebsd-services.com>
      <http://www.Awfulhak.org>;                   <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !          <brian@[uk.]OpenBSD.org>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205181520.g4IFKbWs010806>