no .bashrc?
ok, this is really wierd. im creating new users with the adduser command, and there is no .bashrc in the home dir. ive tried making one, but for some reason it doesnt execute when a user logs in. but for some reason, when i launch a terminal in gnome, it does read it. anyone know how to get it to read it on login?
|
add this to your .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi |
lol, theres no .bash_profile either. and the problem isnt that the .bashrc isnt there, the problem is that it isnt executing
|
.bashrc isn't executed automatically. it's called from
another file. add that to /etc/profile if you want. |
mattman, this may shed a little more light on your situation.
bash can start in two modes, a login shell and a non-login shell. When you login at the CLI, bash starts a login shell. When you are running an xterminal, bash starts a non-login shell. In a login shell, bash looks at /etc/profile and the first of ~/.bash_profile, ~/.bash_login, and ~/.profile In a non-login shell, bash looks at ~/.bashrc That's why your users logging in at the CLI do not have the .bashrc commands execute, but when you open an xterm in gnome they do. As whansard has pointed out, most people just source ~/.bash_profile from ~/.bashrc, so you get the same stuff no matter what kind of shell starts up. |
Thanks for clearing that up.
|
the command to make bash run like it's logging in
is bash --login suprisingly enough. |
All times are GMT -5. The time now is 01:43 PM. |