Bash Does Not Source /etc/profile

Ottavio Caruso ottavio2006-usenet2012 at yahoo.com
Thu Aug 20 20:35:07 UTC 2020


On 20/08/2020 21:03, Gary Aitken wrote:
> On 8/20/20 12:42 PM, Ottavio Caruso via freebsd-questions wrote:
>> On 20/08/2020 19:37, Drew Tomlinson wrote:
>>> I performed an binary upgrade from 12.0-p3 to 12.1-p8 and
>>> recompiled all ports.  My shell is set to /usr/local/bin/bash in
>>> /etc/passwd.  One thing that's puzzling is that /etc/profile is no
>>> longer sourced when I log in. However, if I source /etc/profile
>>> after I log in, there are no errors.
>>>
>>> I have verified my shell is both login and interactive with these
>>> code snippets I found on the web:
>>>
>>> [drew at blackcloud ~]$ shopt -q login_shell && echo 'Login shell' ||
>>> echo 'Not login shell' Login shell [drew at blackcloud ~]$ [[ $- ==
>>> *i* ]] && echo 'Interactive' || echo 'Not interactive' Interactive
>>>
>>> What else should I check?
>>
>> Copy ~/.profile to ~/.bash_profile and source /etc/profile from
>> there.
> 
> I don't *think* a copy should be necessary:
> 

A copy is not necessary. Actually, rewording my original reply, I would 
just create a ~/.bash_profile and a .bashrc and source files from there 
if necessary.



-- 
Ottavio Caruso





More information about the freebsd-questions mailing list