Date: Wed, 9 Jan 2019 16:57:53 +0000 From: Edward Napierala <trasz@freebsd.org> To: rgrimes@freebsd.org Cc: 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: <CAFLM3-owSrKwBDCjMA_672fOGZUstjRyi80GvxtcaMOthnJPaQ@mail.gmail.com> In-Reply-To: <201901091641.x09Gfcc3009116@pdx.rh.CN85.dnsmgr.net> References: <201901091104.x09B4SVZ065656@repo.freebsd.org> <201901091641.x09Gfcc3009116@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
=C5=9Br., 9 sty 2019 o 16:41 Rodney W. Grimes <freebsd@pdx.rh.cn85.dnsmgr.net> napisa=C5=82(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. > 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? 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFLM3-owSrKwBDCjMA_672fOGZUstjRyi80GvxtcaMOthnJPaQ>