[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Console isn't reading the ~/.bashrc file!



From the bash manpage:

When an interactive shell that is not  a  login  shell  is
started,  bash reads and executes commands from ~/.bashrc,
if that file exists.  This may be inhibited by  using  the
--norc  option.   The --rcfile file option will force bash
to  read  and  execute  commands  from  file  instead   of
~/.bashrc.

This is my roots .bash_profile, this is among the first files read at 
start up.

[root@n00bz root]# cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH

you'll notice that there are 2 things here, the setting of BASH_ENV and 
the testing for the existance and then the execution of .bashrc.  check to 
make sure you have this in your .bash_profile.  otherwise it might not get 
hit on the starting of the shell.


hth

tighe


> At Ye Old console...
> 
> root logs in
> root opens /root/.bashrc, adds "alias lt='ls -lt'", saves, quits.
> root logs out
> root logs back in.
> root issues the "lt" command
> BASH executes the command
> 
> root creates newuser
> root logs out
> 
> newuser logs in
> newuser opens /home/newuser/.bashrc, adds "alias lt='ls -lt'", saves, quits.
> newuser logs out
> newuser logs back in.
> newuser issues the "lt" command
> BASH says Command Not Found!
> newuser issues . .bashrc
> newuser issues the "lt" command
> BASH executes the command
> 
> At Ye Old Graphical User Interface..
> 
> newuser logs out
> newuser logs back in
> newuser launches GUI session
> newuser opens xterm
> newuser issues the "lt" command
> BASH executes the command!
> 
> newuser sits in front of his computer in stunned silence wondering why
> he had to source the .bashrc file at the console in order to make the
> "lt" command work?
> 
> -
> To unsubscribe, send email to majordomo@silug.org with
> "unsubscribe silug-discuss" in the body.
> 

-- 
Tighe Schlottog         workape         fiaid
"Nothing is too cruel if it is funny enough."



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.