Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12092

Re: Feature discussion - startup files

From Rob Foehl <rwf@loonybin.net>
Newsgroups gnu.bash.bug
Subject Re: Feature discussion - startup files
Date 2015-12-23 02:49 -0500
Message-ID <mailman.427.1450856969.843.bug-bash@gnu.org> (permalink)
References <56785EE2.3050108@case.edu> <alpine.LFD.2.20.1512212150530.26539@bugs.loonybin.net> <CAG3L380yU=GRX4aHR42MnPYE1PteJP=_aPos6JrYyWgok2wn5Q@mail.gmail.com>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, 22 Dec 2015, Fotis Georgatos wrote:

> Compare bash vs zsh: 
> http://blog.flowblok.id.au/static/images/shell-startup-actual.png # if 
> you have similar diagram for your distro, please post! fi. HPC systems 
> rely on environment modules [1] and bash is still particularly tricky 
> while using it, after 2 decades :-( .

This diagram essentially reiterates my point, if indirectly: not only is 
the current startup excessively complex, it's almost impossible to reason 
about and/or use with any expectation of getting it right.  (Hint: the 
bash portion of the diagram doesn't -- but who can blame them?)

> Users on large platforms flee towards other shells (in practice: that's 
> zsh) due to this sticky issue, which is certainly fixable and, we might 
> even get a chance to fix some of bash_logout's annoyances, too.

If users are already abandoning bash, how is another feature wedged into 
bash going to help?  I don't follow the reasoning here.  Most of what 
could be accomplished with this would be better addressed by something 
shell-agnostic like pam_env, or by just reminding users that if they want 
feature XYZ, they'll need to source /etc/xyz from their shell startup file 
of choice, perhaps via functioning examples in their default files...

>     if you have ever cought yourself to have a messy bash initialization
> file, check it out because it really helps.
>     In fact, with it you could have most of the common configuration for a
> handful of shells *in a single place*.

For whatever it's worth, the way I deal with this is to keep a .profile 
full of POSIX shell to handle most of the environment setup -- including 
undoing the obnoxiousness sourced from vendor files in /etc that I can't 
otherwise convince bash to ignore -- which is in turn sourced by this 
preamble in my .bashrc:

[[ "$-" != *i* ]] && return

. ~/.profile

Those two plus a .bash_profile link to .bashrc cover most cases of 
{,non-}{login,interactive,bash} shells with reasonably correct "just do 
what I want" behavior.

-Rob

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Feature discussion - startup files Rob Foehl <rwf@loonybin.net> - 2015-12-23 02:49 -0500

csiph-web