View previous topic :: View next topic |
Author |
Message |
ARCIS_house n00b
Joined: 08 Jul 2005 Posts: 23
|
Posted: Wed Jul 20, 2005 8:40 am Post subject: bashrc or bash_profile ? |
|
|
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 |
|
|
pitcrawler Apprentice
Joined: 09 Jan 2005 Posts: 155 Location: Oklahoma, USA
|
Posted: Wed Jul 20, 2005 9:46 am Post subject: Re: bashrc or bash_profile ? |
|
|
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 |
|
|
ARCIS_house n00b
Joined: 08 Jul 2005 Posts: 23
|
Posted: Wed Jul 20, 2005 9:55 am Post subject: SOLVED |
|
|
very thanx |
|
Back to top |
|
|
digitaldavid n00b
Joined: 20 Jul 2005 Posts: 6 Location: Hampshire, Uk
|
Posted: Wed Jul 20, 2005 10:21 am Post subject: neubie question about source /etc/profile |
|
|
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. _________________ I often talk absolute rubbish with absolute certainty |
|
Back to top |
|
|
pactoo Guru
Joined: 18 Jul 2004 Posts: 553
|
Posted: Wed Jul 20, 2005 10:51 am Post subject: |
|
|
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 |
|
|
digitaldavid n00b
Joined: 20 Jul 2005 Posts: 6 Location: Hampshire, Uk
|
Posted: Wed Jul 20, 2005 12:40 pm Post subject: |
|
|
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! 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 |
|
|
|