Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #276022

Re: bashrc question

From Frank Jezzer <etphonehomefrance@gmail.com>
Newsgroups linux.debian.user
Subject Re: bashrc question
Date 2024-12-26 17:00 +0100
Message-ID <JXYrf-2VoP-3@gated-at.bofh.it> (permalink)
References <JXMT7-2HHN-5@gated-at.bofh.it>
Organization Unorganized

Show all headers | View raw


On 2024-12-26, henrik@privatembox.com <henrik@privatembox.com> wrote:
> Hello
>
> I have these settings in .bashrc of my home dir:
>
> $ cat .bashrc
> export TF_CPP_MIN_LOG_LEVEL=3
> export CUDA_VISIBLE_DEVICES=-1
>
> but every time after i login the system, the settings are not activated.
> I have to source it by hand to make it work.
>
> what's wrong with me?
>
> Thanks.
>
>
If your .bashrc settings are not applied automatically after login, here are
possible reasons and solutions:

.bashrc Might Not Be Sourced on Login Cause: .bashrc is typically sourced
for non-login shells, while .bash_profile or .profile is sourced for login
shells.

Solution: Add the following line to your .bash_profile (or .profile):

if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi
This ensures that .bashrc is sourced whenever you log in.

Login Shell Behavior Cause: If you're logging in through a graphical
environment (e.g., GNOME, KDE), it might not start a login shell.

Solution: Configure your terminal emulator to launch as a login shell. For
example:

In GNOME Terminal: Go to Preferences > Profiles > Command and check "Run
command as a login shell".  

Shell Type
Cause: If your default shell is not bash, your .bashrc will not be read.

Solution: Confirm your default shell with:

echo $SHELL
If the result is not /bin/bash, change your shell to bash:

chsh -s /bin/bash
Cause: Errors in .bashrc might prevent it from being sourced.

Solution: Check .bashrc for syntax errors:

bash -n ~/.bashrc
Fix any errors if found.

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

bashrc question henrik@privatembox.com - 2024-12-26 04:40 +0100
  Re: bashrc question George at Clug <Clug@goproject.info> - 2024-12-26 04:50 +0100
  Re: bashrc question Greg Wooledge <greg@wooledge.org> - 2024-12-26 05:00 +0100
    Re: bashrc question henrik@privatembox.com - 2024-12-26 09:30 +0100
      Re: bashrc question Chris Green <cl@isbd.net> - 2024-12-26 12:20 +0100
        Re: bashrc question pocket@homemail.com - 2024-12-26 14:00 +0100
        Re: bashrc question Greg Wooledge <greg@wooledge.org> - 2024-12-26 14:10 +0100
          Re: bashrc question henrik@privatembox.com - 2024-12-27 01:10 +0100
  Re: bashrc question Frank Jezzer <etphonehomefrance@gmail.com> - 2024-12-26 17:00 +0100

csiph-web