Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bashrc or bash_profile ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ARCIS_house
n00b
n00b


Joined: 08 Jul 2005
Posts: 23

PostPosted: Wed Jul 20, 2005 8:40 am    Post subject: bashrc or bash_profile ? Reply with quote

I want when i put ls, my show command ls --color , where i must this write
alias ls = 'ls --color' right ? And where must be this file ?
Back to top
View user's profile Send private message
pitcrawler
Apprentice
Apprentice


Joined: 09 Jan 2005
Posts: 155
Location: Oklahoma, USA

PostPosted: Wed Jul 20, 2005 9:46 am    Post subject: Re: bashrc or bash_profile ? Reply with quote

ARCIS_house wrote:
I want when i put ls, my show command ls --color , where i must this write
alias ls = 'ls --color' right ? And where must be this file ?
Add the line to /etc/profile then run the command "source /etc/profile" afterwards.
Back to top
View user's profile Send private message
ARCIS_house
n00b
n00b


Joined: 08 Jul 2005
Posts: 23

PostPosted: Wed Jul 20, 2005 9:55 am    Post subject: SOLVED Reply with quote

:lol: very thanx :)
Back to top
View user's profile Send private message
digitaldavid
n00b
n00b


Joined: 20 Jul 2005
Posts: 6
Location: Hampshire, Uk

PostPosted: Wed Jul 20, 2005 10:21 am    Post subject: neubie question about source /etc/profile Reply with quote

What exactly does
#source /etc/profile
actually do?

if I do
#which source
i get nothing. I've tried doing a find for the source command and got nothing. bash seems to know about it since it offers it as a possible completion for
#s

forgive the dumb question but I am intrigued and would like to learn. :oops:
_________________
I often talk absolute rubbish with absolute certainty
Back to top
View user's profile Send private message
pactoo
Guru
Guru


Joined: 18 Jul 2004
Posts: 553

PostPosted: Wed Jul 20, 2005 10:51 am    Post subject: Reply with quote

With source /somefile or simpler . /somefile that file is read and evaluated, but not executed. That is, it does not spawn a new shell and the settings are therefore valid for the calling shell, too.
source is part of [ba]sh and not a standalone program, that's why which does not find it
Back to top
View user's profile Send private message
digitaldavid
n00b
n00b


Joined: 20 Jul 2005
Posts: 6
Location: Hampshire, Uk

PostPosted: Wed Jul 20, 2005 12:40 pm    Post subject: Reply with quote

pactoo wrote:
With source /somefile or simpler . /somefile that file is read and evaluated, but not executed. That is, it does not spawn a new shell and the settings are therefore valid for the calling shell, too.
source is part of [ba]sh and not a standalone program, that's why which does not find it


Thanks! :D no wonder I was confused.

I google'd and read info pages on bash. It suggests that the commands in the script ARE executed. The key is that they are executed in the current shell not in a newly spawned shell. I thought I should add this in case anyone else reads it.
_________________
I often talk absolute rubbish with absolute certainty
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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