Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2019 11:53:04 -0800
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Ian Lepore <ian@freebsd.org>,rgrimes@freebsd.org
Cc:        Edward Napierala <trasz@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r342881 - head/share/skel
Message-ID:  <287FC341-A997-48FF-B600-61B3EF23D471@cschubert.com>
In-Reply-To: <e3def75e51c78d5a490a0fe3969755c9e0a6c14a.camel@freebsd.org>
References:  <201901111835.x0BIZQZI022410@pdx.rh.CN85.dnsmgr.net> <e3def75e51c78d5a490a0fe3969755c9e0a6c14a.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On January 11, 2019 11:38:14 AM PST, Ian Lepore <ian@freebsd=2Eorg> wrote:
>On Fri, 2019-01-11 at 10:35 -0800, Rodney W=2E Grimes wrote:
>> > On Wed, 2019-01-09 at 10:08 -0800, Rodney W=2E Grimes wrote:
>> > > > ?r=2E, 9 sty 2019 o 16:41 Rodney W=2E Grimes
>> > > > <freebsd@pdx=2Erh=2Ecn85=2Ednsmgr=2Enet> napisa?(a):
>> > > > >=20
>> > > > > > Author: trasz
>> > > > > > Date: Wed Jan  9 11:04:27 2019
>> > > > > > New Revision: 342881
>> > > > > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/342881
>> > > > > >=20
>> > > > > > Log:
>> > > > > >   Make sh(1) recognize the default $HOME=2E  By default /home
>> > > > > >   is a symlink; without this change, when you log in, sh(1)
>> > > > > >   won't realize the current directory (eg '/usr/home/test')
>> > > > > >   is the same as $HOME ('/home/test')=2E
>> > > > >=20
>> > > > > Arguably it shouldnt know any of that=2E
>> > > >=20
>> > > > sh(1) needs to know that in order to properly shorten the
>> > > > current
>> > > > directory path (in prompt) to "~" when you're there=2E
>> > >=20
>> > > And imho it should not be doing that=2E=2E=2E=2E
>> > > that is what leads to all this other un needed cruft=2E
>> > >=20
>> > > ~ is a human input shortcut, not a computer output shortcut
>> > >=20
>> > > >=20
>> > > > > Or that $Home is ~ either
>> > > > > I hate that if I "cd home" and there is not a directory
>> > > > > where I am at called home it takes me to ~/$home,s
>> > > > > that also has caused a few script debugging to be
>> > > > > a royal Pita having to force =2E/$variable to stop
>> > > > > home from being treated special=2E
>> > > >=20
>> > > > But none of that seems related to the change above, does it?
>> > >=20
>> > > It is all related as this is outgrowth of trying to make
>> > > the prompt spit out ~ when you are in $HOME=2E
>> > >=20
>> > > > All the patch does is: if your current directory is $HOME, but
>> > > > it's spelled differently, run "cd"=2E  The only thing that does,
>> > > > in
>> > > > turn,
>> > > > is making sh(1) set the $ENV variable, which it uses to track
>> > > > the current "logical working directory", eg /home/test=2E It
>> > > > cannot
>> > > > obtain that information otherwise, because getcwd(3) in that
>> > > > directory returns its "physical path", eg /usr/home/test=2E
>> > >=20
>> > > It SHOULD spit out the results of getcwd and not some
>> > > logical interpretation of variables=2E  Do any OTHER cd's
>> > > through a symbolic link do such magic?
>> > >=20
>> >=20
>> > ALL cd's through a symlink "do such magic"=2E It's the difference
>> > between
>> > physical and logical path in bourne shell (and its descendents)=2E
>> >=20
>> >    revolution > mkdir /tmp/ian
>> >    revolution > cd /tmp/ian
>> >=20
>> >    revolution > mkdir -p a/b/c
>> >    revolution > ln -s a/b/c c
>> >=20
>> >    revolution > cd /tmp/ian/a/b/c; pwd -L; pwd -P
>> >    /tmp/ian/a/b/c
>> >    /tmp/ian/a/b/c
>> >=20
>> >    revolution > cd /tmp/ian/c; pwd -L; pwd -P
>> >    /tmp/ian/c
>> >    /tmp/ian/a/b/c
>> >=20
>> >    revolution > cd /tmp/ian/a/b/c; cd =2E=2E; pwd -P
>> >    /tmp/ian/a/b
>> >=20
>> >    revolution > cd /tmp/ian/c; cd =2E=2E; pwd -P
>> >    /tmp/ian
>>=20
>> The whole concept of logical cd/pwd is broken
>> because it only works with cd, if you start
>> to do ls and other commands the consistency
>> of things like =2E=2E goes out the window!
>>=20
>>=20
>
>What you seem to be implying is some kind of bug is what I consider to
>be one of the strongest features of logical vs=2E physical paths in
>bourne shell=2E Those of us who use it understand its behavior and work
>with it instead of complaining about it=2E People who believe otherwise
>tend to use other shells, I suspect=2E  Everybody wins=2E
>
>-- Ian


Not just our Bourne shell IIRC Solaris and others as well=2E

One should compare this with the folks maintaining ksh93 at att/ast on git=
hub=2E=20

--=20
Pardon the typos, small keyboard in use=2E
Cheers,
Cy Schubert <Cy=2ESchubert@cschubert=2Ecom>
FreeBSD UNIX: <cy@FreeBSD=2Eorg> Web: http://www=2EFreeBSD=2Eorg

	The need of the many outweighs the greed of the few=2E



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?287FC341-A997-48FF-B600-61B3EF23D471>