View previous topic :: View next topic |
Author |
Message |
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 7:49 pm Post subject: difference between /etc/profile and ~/.bashrc |
|
|
Hi,
when I open a x-term session ~/.bashrc seems to be loaded but /etc/profile is not.
When I log on from "F1" /etc/profile is loaded.
How can I change that so my prompt is coloured.
Thanks,
Chris |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Mon Mar 28, 2005 7:51 pm Post subject: |
|
|
Run the xterm with the "-ls" argument (you'll probably need to update your GUI menu to do this). |
|
Back to top |
|
|
Unther Apprentice
Joined: 20 Feb 2005 Posts: 163
|
Posted: Mon Mar 28, 2005 7:53 pm Post subject: |
|
|
My solution was to add
Code: | source /etc/profile |
to the end of my .bashrc file. |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 8:56 pm Post subject: |
|
|
Sven Vermeulen wrote: | Run the xterm with the "-ls" argument (you'll probably need to update your GUI menu to do this). |
What does the "-ls" do? Where does it take its information from(which file? is it /etc/profile)?
Thanks,
Chris |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 8:59 pm Post subject: |
|
|
Unther wrote: | My solution was to add
Code: | source /etc/profile |
to the end of my .bashrc file. |
Wouldn't work unless you are locked in as root since /etc/profile's permission are set to "-rw-r--r--" so only root can execute.
Thanks,
Chris |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Mon Mar 28, 2005 9:01 pm Post subject: |
|
|
yellowhippy wrote: |
What does the "-ls" do?
|
xterm manpage wrote: |
This option indicates that the shell that is started in the
xterm window will be a login shell (i.e., the first character
of argv[0] will be a dash, indicating to the shell that it
should read the user's .login or .profile).
|
|
|
Back to top |
|
|
Nard` Apprentice
Joined: 23 Jan 2005 Posts: 250
|
Posted: Mon Mar 28, 2005 9:01 pm Post subject: |
|
|
yellowhippy wrote: | Unther wrote: | My solution was to add
Code: | source /etc/profile |
to the end of my .bashrc file. |
Wouldn't work unless you are locked in as root since /etc/profile's permission are set to "-rw-r--r--" so only root can execute.
Thanks,
Chris |
what? that's not true. first /etc/profile doesn't even contain a shabang so it's not executable. second it doesnt have an executable bit so root can't execute it either! root still obeys permissions like that, although he can change them
also, source doesn't execute it, it sources it, that is it runs it as a shell script under the shell. using your terminal emulator as a login shell is indeed a better option though. _________________ Programming is the process of putting bugs in.
Debugging is the process of attempting to take bugs out, doing an ugly hack, hitting your computer, then claiming insurance. |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 9:07 pm Post subject: |
|
|
Nard` wrote: |
what? that's not true. first /etc/profile doesn't even contain a shabang so it's not executable. second it doesnt have an executable bit so root can't execute it either! root still obeys permissions like that, although he can change them
also, source doesn't execute it, it sources it, that is it runs it as a shell script under the shell. using your terminal emulator as a login shell is indeed a better option though. |
My fault. Sorry for that. My /etc/profile is set so it is executable for root only. Does that mean I can change that? Should I change that?
Thanks,
Chris |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 9:30 pm Post subject: |
|
|
Sven Vermeulen wrote: | yellowhippy wrote: |
What does the "-ls" do?
|
xterm manpage wrote: |
This option indicates that the shell that is started in the
xterm window will be a login shell (i.e., the first character
of argv[0] will be a dash, indicating to the shell that it
should read the user's .login or .profile).
|
|
If I try to source .bashrc manually nothing happens. And where is stored which colours xterm uses?
Thanks again,
Chris |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Mon Mar 28, 2005 9:49 pm Post subject: |
|
|
The colors are defined in /etc/DIR_COLORS afaik. |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Mon Mar 28, 2005 11:53 pm Post subject: |
|
|
Thanks for your help.
Chris |
|
Back to top |
|
|
|