bash profiles

Björn Lindberg d95-bli at
Wed Jul 2 05:51:25 PDT 2003

dagmar.wants at (Dagmar d'Surreal) writes:

> Because /etc/profile is *not* some magically ordained file.  It is the
> file read by _bash_ [1] to complete construction of the user's
> environment.  It is read by bash.  Bash being a type of shell which as a
> shell is designed for interactive use on text-based displays.  Bash not
> being a window manager, which is _another_ kind of shell.  If you were
> to remove bash from the system, then logically /etc/profile should
> probably go with it [2].  If bash weren't around and the system were
> ksh-based, /etc/profile wouldn't likely even be there.

Just a little nitpick... /etc/profile actually isn't a bash-specific
file at all. It is used by sh (the original Bourne shell) and
derivatives, basically all shells of the Bourne family. On a normal
Linux installation, ash, ksh and bash will read /etc/profile. This
doesn't negate anything you've been saying so far in regards to window
managers and such things, but it has the consequence that /etc/profile
should not contain any bash-specific commands, either in semantics or
in syntax. For instance, special variables controlling the shell
history, or set/typeset/alias commands, shell functions, etc, should
go in a shell specific file, not in /etc/profile. Global shell
specific files can still be had by eg setting ENV or BASH_ENV from
/etc/profile. My terribly outdated shells hint contains a small
section on shell startup files at the end (I *will* try to update this
hint soon :-).

> > And how many of us really want a different path
> > set up
> > for login and non-login interactive shells - I think most of us want
> > them to act
> > essentially the same, which is why we all have such a problem with this
> > stuff.

For one thing, having /usr/X11R6/bin in my path hardly seems necessary
when I'm not running X, ie when on a console.

Unsubscribe: send email to listar at
and put 'unsubscribe blfs-support' in the subject header of the message

More information about the blfs-support mailing list