[offtopic] Re: [PLUG] .profile

A Braunsdorf ab@eas.purdue.edu
Thu, 02 Sep 1999 10:26:08 -0500


Doesn't anyone read manuals anymore?

man bash:
> 
> When  bash is invoked as an interactive login shell, or as
> a non-interactive shell with the --login option, it  first
> reads and executes commands 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  behav-
> ior.

So put your sh stuff in .profile and your bash stuff in .bash_profile.
Even if it did run both, you could set a variable to stop anything
bad from happening.

I did a similar thing when my dot files had to work under both ksh
and bash.  The other alternative is to just use ksh, which is
probably on all PUCC and ECN machines since it ships with AIX and
Solaris (and other Sys V variants).  Additionally, there are a
number of ksh fans on the PUCC staff- or at least used to be when
I was there.  Enough we used to pay for it in the pre-usable pdksh
days.

If you like one of bash or ksh, you can learn to like the other.
I finally settled on just bash because I have the same version of
it on all my machines.  Of course, I don't use PUCC machines
anymore...

ab