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

From: Jackie <jiangjun12321_at_yahoo.com>
Date: Tue, 17 Oct 2023 13:43:03 UTC
<div dir='auto'><div><div class="gmail_extra"><div class="gmail_quote"><br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Mon, Oct 16, 2023 at 01:55:46PM +0000, Jackie J wrote:
<br>

<br>
&gt;However, I found that ~/bin in my PATH won't work in tcsh as it got 
<br>
&gt;"command not found" error, I have to use something like $HOME/bin or 
<br>
&gt;hard-code like /home/myusername/bin. Apparently ~ was not interpreted. 
<br>
&gt;I checked and it seemed that I got this setting from /etc/login.conf 
<br>
&gt;(part shown here):
<br>
&gt;
<br>
&gt;default:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :passwd_format=sha512:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :copyright=/etc/COPYRIGHT:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :welcome=/var/run/motd:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :setenv=BLOCKSIZE=K:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :mail=/var/mail/$:\
<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin 
<br>
&gt;/usr/local/bin ~/bin:\
<br>

<br>
I use ~/bin that way, and it's interpreted -- it shows up as 
<br>
/home/myusername/bin in the environment variable PATH.
<br>

</p></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">What shell are you using as default? Can you confirm that you didn't set PATH in any other dot files or in /etc files?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr"><br>
/etc/login.conf (and ~/.login.conf) have to be converted into databases 
<br>
by cap_mkdb(1).&nbsp; That's documented in the man page login.conf(5) -- 
<br>
documented eventually, down a page or so.&nbsp; Is that database present, in 
<br>
/etc/login.conf.db?
<br>

<br>
</p>
</blockquote></div>I am not sure it's needed since I didn't make any modification to /etc/login.conf or&nbsp; ~/.login_conf (notice the file not in ~ is not .login.conf as per man 5 login.conf). Anyway I issued cap_mkdb command, logout and in, nothing changes. ~ is still not expanded to HOME as expected.</div></div></div>