Date: Tue, 26 Oct 2021 08:40:54 -0700 From: Cy Schubert <Cy.Schubert@cschubert.com> To: Ian Lepore <ian@freebsd.org> Cc: Ka Ho Ng <khng@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: fcfa64801a4f - main - sh: Set PATH envvar after setting HOME in dotfile Message-ID: <202110261540.19QFesnX010998@slippy.cwsent.com> In-Reply-To: <57f6f877de121954935225fba9874a39b6b768c4.camel@freebsd.org> References: <202110261450.19QEoMqo020433@gitrepo.freebsd.org> <57f6f877de121954935225fba9874a39b6b768c4.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <57f6f877de121954935225fba9874a39b6b768c4.camel@freebsd.org>, Ian Le pore writes: > On Tue, 2021-10-26 at 14:50 +0000, Ka Ho Ng wrote: > > The branch main has been updated by khng: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=fcfa64801a4fe836ff481465ea068e791aa > 4ce6a > > > > commit fcfa64801a4fe836ff481465ea068e791aa4ce6a > > Author: Ka Ho Ng <khng@FreeBSD.org> > > AuthorDate: 2021-10-26 14:48:57 +0000 > > Commit: Ka Ho Ng <khng@FreeBSD.org> > > CommitDate: 2021-10-26 14:50:09 +0000 > > > > sh: Set PATH envvar after setting HOME in dotfile > > > > In single-user mode, all env vars are absent, so exptilde() would > > not be > > able to expand ~ correctly. > > Place the lines setting PATH below HOME, so exptilde() would work > > as > > expected. > > > > Sponsored by: The FreeBSD Foundation > > MFC after: 3 days > > Reviewed by: jilles, emaste > > Differential Revision: https://reviews.freebsd.org/D27003 > > --- > > bin/sh/dot.profile | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/bin/sh/dot.profile b/bin/sh/dot.profile > > index fd0c43fdb927..e296a360bcc7 100644 > > --- a/bin/sh/dot.profile > > +++ b/bin/sh/dot.profile > > @@ -1,9 +1,9 @@ > > # $FreeBSD$ > > # > > - > > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bi > > n > > -export PATH > > HOME=/root > > export HOME > > +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/ > > bin > > +export PATH > > TERM=${TERM:-xterm} > > export TERM > > PAGER=less > > I've always been curious whether there's a reason we seem to favor > > VAR=value > export VAR > > over the more compact form > > export VAR=value Older Bourne shells don't support export VAR=value. This gives the user greater flexibility to choose an older shell as their login shell. -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org NTP: <cy@nwtime.org> Web: https://nwtime.org The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110261540.19QFesnX010998>