In /etc/login.defs, the default PATH is set up:
#
# *REQUIRED* The default PATH settings, for superuser and normal
users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/foo
ENV_PATH PATH=/foo
So, in /etc/profile I have:
PATH="$PATH:/bar"
export PATH
This is all well and good. echo $PATH correctly shows /foo:/bar
However, if I invoke an xterm with -ls as an argment, echo $PATH
yeilds /foo:/bar:/bar. My guess is that PATH is already set before
xterm runs through /etc/profile (which has PATH=$PATH:/bar).
Why does this happen? What's the workaround?
I have "XTerm*loginShell: true" in my ~/.Xdefaults file, so this
behavior is an annoyance in all of my xterms by default. I like the
login shell invoked b/c I have aliases, PS1 prompts, etc getting set
in .profile and .kshrc