Results 1 to 4 of 4
The .bashrc is used for non-login shells, so when I make make any changes in it, like type echo hello, it reflects when I open a new VT(Virtual Terminal, by ...
- 06-14-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 12
effect of system-wide and local .profile file
The .bashrc is used for non-login shells, so when I make make any changes in it, like type echo hello, it reflects when I open a new VT(Virtual Terminal, by clicking on the Terminal icon). But, the .profile file is for the login shell only. If I make any changes to that file (before the point it calls the .bashrc file), where do the changes reflect? in the login shell(the page is so nice, it hardly seems to be a shell). I am asking this because the .profile file is in our home directory, and login shells should have nothing to do with a particular user's file (its general, for all users). There is also a system-wide .profile file. Does editing this, change the login prompt because its not particular to a user.
- 06-14-2010 #2
I was under the assumption that a login shell is not the
login prompt, but the shell you get when you
first log in to the system, as opposed to other instances
of the shell you invoke later. The global .profile will affect
all users and the .profile in your home directory will affect
you alone.
I guess one way to experiment would to log in remotely.
If you have another computer, and run ssh, you could
compare the environment with that of a local shell. Since
many of us run a graphical desktop, we don't actually
see the login shell like we used to.
- 06-14-2010 #3
.bash_profile in the user's home directory is sourced when doing ssh logins.
For example, to get .bashrc sourced when I ssh into my home computer from a remote location, I had to create a file ~/.bash_profile with the contents
Code:if [ -f ~/.bashrc ]; then . ~/.bashrc fi
- 06-14-2010 #4Just Joined!
- Join Date
- May 2010
- Posts
- 12
Thanks
I get the following :
1. We can only see the login shell only when we login from another computer, not from the same computer.
2. Even after we login from another computer, we remain in the same login shell until we type sh. Thereafter we are in a non-login shell.
Am I right ?


Reply With Quote