Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh

From: Jackie <jiangjun12321_at_yahoo.com>
Date: Wed, 18 Oct 2023 05:28:18 UTC
<div dir='auto'><div class="gmail_extra" dir="auto"><div class="gmail_quote">This is odd. I tried with a VM running lastest FreeBSD RELEASE 13.2-p4, but without X environment yet. Nothing about $PATH is set in dot files either and login at tty get ~ expanded to $HOME.&nbsp;</div><div class="gmail_quote" dir="auto">I was using a desktop running the same version of FreeBSD. Although I use lightdm to login to a MATE desktop environment. Will do more tests tonight when I get home.&nbsp;</div><div class="gmail_quote" dir="auto"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Tue, Oct 17, 2023 at 09:43:03PM +0800, Jackie wrote:
<br>

<br>
&gt;What shell are you using as default? Can you confirm that you didn't 
<br>
&gt;set PATH in any other dot files or in /etc files?
<br>

<br>
I use bash, and set PATH in ~/.login_conf.
<br>

<br>
However, I can't reproduce your problem.&nbsp; I moved aside ~/.login_conf 
<br>
and its .db, changed my login shell to tcsh, logged out and in, and got 
<br>
the PATH from /etc/login.conf, with ~/bin expanded.&nbsp; So I don't know 
<br>
what's going on.
<br>

<br>
I did this with FreeBSD 13.2 and tcsh 6.22.04, which apparently comes 
<br>
with base FreeBSD (it's in /bin).
<br>

<br>
Runnings "strings" on /etc/login.conf.db shows :path=...~/bin:, so the 
<br>
expansion is not done when converting the text file to a database.&nbsp; I 
<br>
guess it's done during login or shell startup.
<br>

<br>
I run X and log in through xdm.&nbsp; Maybe logging in some other way -- 
<br>
console? -- behaves differently?
<br>

<br>
</p>
</blockquote></div><br></div></div>