From owner-svn-src-head@freebsd.org Fri Jan 11 18:35:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C93521498197; Fri, 11 Jan 2019 18:35:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA5377988; Fri, 11 Jan 2019 18:35:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0BIZQBK022411; Fri, 11 Jan 2019 10:35:26 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0BIZQZI022410; Fri, 11 Jan 2019 10:35:26 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901111835.x0BIZQZI022410@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342881 - head/share/skel In-Reply-To: <8065ff94389d86d5c427e5cca14af3a37311fa0e.camel@freebsd.org> To: Ian Lepore Date: Fri, 11 Jan 2019 10:35:26 -0800 (PST) CC: rgrimes@freebsd.org, Edward Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: AEA5377988 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.40 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.69)[0.694,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.74)[0.740,0]; NEURAL_SPAM_MEDIUM(0.09)[0.086,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.01)[ip: (0.03), ipnet: 69.59.192.0/19(0.01), asn: 13868(-0.02), country: US(-0.08)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 18:35:32 -0000 > On Wed, 2019-01-09 at 10:08 -0800, Rodney W. Grimes wrote: > > > ?r., 9 sty 2019 o 16:41 Rodney W. Grimes > > > napisa?(a): > > > > > > > > > Author: trasz > > > > > Date: Wed Jan 9 11:04:27 2019 > > > > > New Revision: 342881 > > > > > URL: https://svnweb.freebsd.org/changeset/base/342881 > > > > > > > > > > Log: > > > > > Make sh(1) recognize the default $HOME. 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'). > > > > > > > > Arguably it shouldnt know any of that. > > > > > > sh(1) needs to know that in order to properly shorten the current > > > directory path (in prompt) to "~" when you're there. > > > > And imho it should not be doing that.... > > that is what leads to all this other un needed cruft. > > > > ~ is a human input shortcut, not a computer output shortcut > > > > > > > > > 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 ./$variable to stop > > > > home from being treated special. > > > > > > But none of that seems related to the change above, does it? > > > > It is all related as this is outgrowth of trying to make > > the prompt spit out ~ when you are in $HOME. > > > > > All the patch does is: if your current directory is $HOME, but > > > it's spelled differently, run "cd". 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. It cannot > > > obtain that information otherwise, because getcwd(3) in that > > > directory returns its "physical path", eg /usr/home/test. > > > > It SHOULD spit out the results of getcwd and not some > > logical interpretation of variables. Do any OTHER cd's > > through a symbolic link do such magic? > > > > ALL cd's through a symlink "do such magic". It's the difference between > physical and logical path in bourne shell (and its descendents). > > revolution > mkdir /tmp/ian > revolution > cd /tmp/ian > > revolution > mkdir -p a/b/c > revolution > ln -s a/b/c c > > revolution > cd /tmp/ian/a/b/c; pwd -L; pwd -P > /tmp/ian/a/b/c > /tmp/ian/a/b/c > > revolution > cd /tmp/ian/c; pwd -L; pwd -P > /tmp/ian/c > /tmp/ian/a/b/c > > revolution > cd /tmp/ian/a/b/c; cd ..; pwd -P > /tmp/ian/a/b > > revolution > cd /tmp/ian/c; cd ..; pwd -P > /tmp/ian 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 .. goes out the window! # cd /tmp # mkdir a # cd a # ln -s /usr/src # ls src # cd src # pwd /tmp/a/src # ls .. bin lib32 local sbin src-bhyve.8 src-structvm include libdata obj share src-maxcpus src-structvmaccessor lib libexec ports src src-maxcpusDS tests # cd .. # ls src # OMG, where did my system go???? :-) -- Rod Grimes rgrimes@freebsd.org