Date: Wed, 9 Jan 2019 08:41:38 -0800 (PST) From: "Rodney W. Grimes" <freebsd@pdx.rh.CN85.dnsmgr.net> To: Edward Tomasz Napierala <trasz@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342881 - head/share/skel Message-ID: <201901091641.x09Gfcc3009116@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901091104.x09B4SVZ065656@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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. 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. > > Reviewed by: jilles > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18775 > > Modified: > head/share/skel/dot.profile > > Modified: head/share/skel/dot.profile > ============================================================================== > --- head/share/skel/dot.profile Wed Jan 9 09:36:54 2019 (r342880) > +++ head/share/skel/dot.profile Wed Jan 9 11:04:27 2019 (r342881) > @@ -21,6 +21,9 @@ PAGER=less; export PAGER > # set ENV to a file invoked each time sh is started for interactive use. > ENV=$HOME/.shrc; export ENV > > +# Let sh(1) know it's at home, despite /home being a symlink. > +if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi > + > # Query terminal size; useful for serial lines. > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > -- Rod Grimes rgrimes@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901091641.x09Gfcc3009116>