Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
difference between /etc/profile and ~/.bashrc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 7:49 pm    Post subject: difference between /etc/profile and ~/.bashrc Reply with quote

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. :D

Thanks,

Chris
Back to top
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Mon Mar 28, 2005 7:51 pm    Post subject: Reply with quote

Run the xterm with the "-ls" argument (you'll probably need to update your GUI menu to do this).
Back to top
View user's profile Send private message
Unther
Apprentice
Apprentice


Joined: 20 Feb 2005
Posts: 163

PostPosted: Mon Mar 28, 2005 7:53 pm    Post subject: Reply with quote

My solution was to add
Code:
source /etc/profile

to the end of my .bashrc file.
Back to top
View user's profile Send private message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 8:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Mon Mar 28, 2005 9:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nard`
Apprentice
Apprentice


Joined: 23 Jan 2005
Posts: 250

PostPosted: Mon Mar 28, 2005 9:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 9:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 9:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Mon Mar 28, 2005 9:49 pm    Post subject: Reply with quote

The colors are defined in /etc/DIR_COLORS afaik.
Back to top
View user's profile Send private message
chrism
Guru
Guru


Joined: 15 Jul 2004
Posts: 526

PostPosted: Mon Mar 28, 2005 11:53 pm    Post subject: Reply with quote

Thanks for your help.

Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum