Thanks for the continued suggestions of help on getting ~/.bash_profile to be read. I 
developed my own thoughts and detail them below showing a practice of where user 
aliases, functions and variables should be placed.  

Let me recap my dilemma for posterity and other novices:

I have learned an understanding of the difference between a login shell and an 
interactive non-login shell is necessary. Reading the man pages for bash has helped. 
The man pages explained, in detail, the shell invocation differences and how 
~/.bash_profile is read or not read between a login or interactive non-login shell.

My experience with shells has really been in two manners:

1. Via a terminal, i.e. CMD on Windoze, and SSHing to my RHL 7.3 box.
2. Via invoking KONSOLE in KDE on my Linux box.

In the first scenario the SSH session starts a *login* shell.

In the second scenario, I use KDE's konsole to open a shell via ALT-F2, and the shell 
is defined in /etc/passwd as bash (the RHL default). This shell is an interactive 
*non-login* shell, hence ~/.bash_profile will not be invoked. 

My most recent follow up asked what the best practices are in using ~/.bashrc and 
~/.bash_profile. And some may wish to elaborate on how their environments work.

I will close by saying I'm developing a hypothesis for my best practice:

~/.bashrc should contain user aliases, functions and variables for the local system 
that builds on /etc/bashrc
~/.bash_profile should contain user aliases, functions and variables for remote 
sessions (needing a login shell); these environment settings should build on the 
~/.bashrc settings or reset them based on the needs of the remote session.

So if both a remote session and local session need the same *base* CLASSPATH, set it 
in ~/.bashrc. 
Build on the base CLASSPATH in ~/.bash_profile if the remote session needs something 
more (or less).
For example ~/.bash_profile might read:

unset CLASSPATH
export CLASSPATH=my:new:classpaths
#or when $CLASSPATH has base settings in ~/.bashrc
#export CLASSPATH=$CLASSPATH:my:additional:classpaths

Comments and thoughts welcome.

Thanks again and warmest regards,
Tim



> -----Original Message-----
> From: Todd A. Jacobs [mailto:nospam@;codegnome.org]
> Sent: Friday, November 01, 2002 01:34
> To: [EMAIL PROTECTED]
> Subject: Re: need help with ~/.bash_profile
> 
> 
> On Thu, 31 Oct 2002, Stone, Timothy wrote:
> 
> > Is there something I'm missing here? Something that needs 
> to be turned
> 
> You've probably failed to export the variable. You can either:
> 
>       export SOME_VARIABLE=foo
> 
> or:
>       
>       SOME_VARIABLE=foo
>       export SOME_VARIABLE
> 
> But either way, the only way to allow subshells to inherit 
> the variable is 
> to export it to the environment.
> 
> -- 
> "Whenever I feel blue, I start breathing again."
> 
>                              - Unknown
> 
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to