Renat Golubchyk wrote:
> That's wrong. Quote:
>
> "When  bash is invoked as an interactive login shell, or as a non-inter-
> active shell with the --login option, it first reads and executes  com-
> mands  from  the file /etc/profile, if that file exists.  After reading
> that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
> in  that order, and reads and executes commands from the first one that
> exists and is readable. The --noprofile option may be  used  when  the
> shell is started to inhibit this behavior."
>
> Notice "the first one that exists and is readable".
>
>   
>> If "~/.bash_profile" doesn't exist, then "~/.bashrc" won't be sourced
>> whether it exists or not.
>>     
>
> Wrong again. Two paragraphs down in the man page:
>
> "When an interactive shell that is not a login shell  is  started, bash
> reads  and executes commands from ~/.bashrc, if that file exists."
>
> In this case ~/.bashrc is sourced directly.
>
>
> Cheers,
> Renat
>   
Rats.  I checked the source and you're right.  My problem domain is
smaller than I thought but still valid, I think.  Basically the problem
is only with interactive login shells and /root.  Not *broken*, per se: 
just contrary to recommended practice.  The Bash documentation
*recommends* that a ~/.bash_profile exists so that ~/.bashrc can be made
to be sourced for login shells and codifies its recommendation by
putting a template .bash_profile in /etc/skel.

- John
-- 
[EMAIL PROTECTED] mailing list

Reply via email to