Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Oct 2023 13:48:42 UTC
<div dir='auto'><div dir="auto"></div><div><div class="elided-text"><br type="attribution"><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Mon, Oct 16, 2023 at 09:56:08AM -0400, Jackie J wrote: <br> <br> > When I checked $PATH in terminal I was happy to see that ~/bin <br> > was included and so I intended to put some scripts as shortcuts <br> > to long commands and simple tasks there. However, I found that <br> > ~/bin in my PATH won't work in tcsh as it got "command not found" <br> > error, I have to use something like $HOME/bin or hard-code like <br> > /home/myusername/bin. Apparently ~ was not interpreted. <br> <br> I've never been able to get "~" interpreted as $HOME in my TCSH <br> startup files, so I resort to this in my .tcshrc: <br> <br> # If running with an empty environment, set some basic stuff. <br> if (! $?HOME) then <br> setenv PATH /usr/local/bin:/bin:/usr/bin <br> setenv HOME `getent passwd "${LOGNAME}" | cut -f6 -d:` <br> endif <br> <br> # Remaining aliases, prompt, etc. <br> if ( -e $HOME/.cshrc ) then <br> source $HOME/.cshrc <br> endif <br> <br> if ( -e $HOME/.aliases ) then <br> source $HOME/.aliases <br> endif <br> <br> if ( -e $HOME/.envrc.csh ) then <br> source $HOME/.envrc.csh <br> endif <br> <br> # ... <br> <br> -- <br> Karl Vogel I don't speak for anyone but myself <br> <br> Save the trees, wipe your butt with an owl. --bumper sticker <br> <br> </p> </blockquote></div><br></div><div dir="auto">Good to know that I am not alone here. I was suspecting what I was doing wrong before.</div></div>