bashrc not loaded on login
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc
after I log in. How can I save keystrokes so this is done automatically?
bash
add a comment |Â
up vote
1
down vote
favorite
I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc
after I log in. How can I save keystrokes so this is done automatically?
bash
thats only for interactive shells - you might want to put those commands into~/.profile
or~/.bash_profile
instead
â Steven Penny
Jun 5 at 20:54
Is your default shellbash
?.bashrc
won't run forzsh
,sh
,ash
,csh
, etc.
â DopeGhoti
Jun 5 at 21:16
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc
after I log in. How can I save keystrokes so this is done automatically?
bash
I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc
after I log in. How can I save keystrokes so this is done automatically?
bash
asked Jun 5 at 20:51
Rekall
83
83
thats only for interactive shells - you might want to put those commands into~/.profile
or~/.bash_profile
instead
â Steven Penny
Jun 5 at 20:54
Is your default shellbash
?.bashrc
won't run forzsh
,sh
,ash
,csh
, etc.
â DopeGhoti
Jun 5 at 21:16
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32
add a comment |Â
thats only for interactive shells - you might want to put those commands into~/.profile
or~/.bash_profile
instead
â Steven Penny
Jun 5 at 20:54
Is your default shellbash
?.bashrc
won't run forzsh
,sh
,ash
,csh
, etc.
â DopeGhoti
Jun 5 at 21:16
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32
thats only for interactive shells - you might want to put those commands into
~/.profile
or ~/.bash_profile
insteadâ Steven Penny
Jun 5 at 20:54
thats only for interactive shells - you might want to put those commands into
~/.profile
or ~/.bash_profile
insteadâ Steven Penny
Jun 5 at 20:54
Is your default shell
bash
? .bashrc
won't run for zsh
, sh
, ash
, csh
, etc.â DopeGhoti
Jun 5 at 21:16
Is your default shell
bash
? .bashrc
won't run for zsh
, sh
, ash
, csh
, etc.â DopeGhoti
Jun 5 at 21:16
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You could link your .bash_login
- used when you login - to your .bashrc
- used for other bash
shell sessions:
mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login
Ensure that the commands in your .bashrc
can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.
add a comment |Â
up vote
0
down vote
Bash is not POSIX compliant here.
Any interactive shell should read the file $ENV in the users home directory, but bash
reads $HOME/.bash_login
instead in case it is a login shell and even reads this file before reading $HOME/.profile
instead of reading it after that file.
Fortunately, this deviating behavior is documented in the bash
man page under the section INVOCATION that starts aprox. at page #3.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You could link your .bash_login
- used when you login - to your .bashrc
- used for other bash
shell sessions:
mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login
Ensure that the commands in your .bashrc
can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.
add a comment |Â
up vote
1
down vote
accepted
You could link your .bash_login
- used when you login - to your .bashrc
- used for other bash
shell sessions:
mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login
Ensure that the commands in your .bashrc
can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You could link your .bash_login
- used when you login - to your .bashrc
- used for other bash
shell sessions:
mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login
Ensure that the commands in your .bashrc
can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.
You could link your .bash_login
- used when you login - to your .bashrc
- used for other bash
shell sessions:
mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login
Ensure that the commands in your .bashrc
can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.
answered Jun 5 at 20:59
roaima
39.2k544105
39.2k544105
add a comment |Â
add a comment |Â
up vote
0
down vote
Bash is not POSIX compliant here.
Any interactive shell should read the file $ENV in the users home directory, but bash
reads $HOME/.bash_login
instead in case it is a login shell and even reads this file before reading $HOME/.profile
instead of reading it after that file.
Fortunately, this deviating behavior is documented in the bash
man page under the section INVOCATION that starts aprox. at page #3.
add a comment |Â
up vote
0
down vote
Bash is not POSIX compliant here.
Any interactive shell should read the file $ENV in the users home directory, but bash
reads $HOME/.bash_login
instead in case it is a login shell and even reads this file before reading $HOME/.profile
instead of reading it after that file.
Fortunately, this deviating behavior is documented in the bash
man page under the section INVOCATION that starts aprox. at page #3.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Bash is not POSIX compliant here.
Any interactive shell should read the file $ENV in the users home directory, but bash
reads $HOME/.bash_login
instead in case it is a login shell and even reads this file before reading $HOME/.profile
instead of reading it after that file.
Fortunately, this deviating behavior is documented in the bash
man page under the section INVOCATION that starts aprox. at page #3.
Bash is not POSIX compliant here.
Any interactive shell should read the file $ENV in the users home directory, but bash
reads $HOME/.bash_login
instead in case it is a login shell and even reads this file before reading $HOME/.profile
instead of reading it after that file.
Fortunately, this deviating behavior is documented in the bash
man page under the section INVOCATION that starts aprox. at page #3.
answered Jun 6 at 10:39
schily
8,63821435
8,63821435
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448079%2fbashrc-not-loaded-on-login%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
thats only for interactive shells - you might want to put those commands into
~/.profile
or~/.bash_profile
insteadâ Steven Penny
Jun 5 at 20:54
Is your default shell
bash
?.bashrc
won't run forzsh
,sh
,ash
,csh
, etc.â DopeGhoti
Jun 5 at 21:16
@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
â Rekall
Jun 5 at 21:32