> If I login as me, my path is set as defined in my .profile. If I login
> as root, my path is set as defined in /.bashrc. No problems.
> BUT if I login as me, and then "su", my path becomes
> "/usr/sbin:/usr/bin" (determined by using "which").
> Where is this set (under Solaris 7)?
Look into /etc/default directory. There are two files, login and su
and in both of them you will find lines for defining PATH and SUPATH
variables (commented by default, but with default values). They set
default path for all login shells when you log in (PATH), and default
path when you "su" (SUPATH). Be aware that login and su are not shell
scripts. They have similar syntax for setting variables and for
comments like shell scripts and that is it.
/etc/profile and your .profile are executed when you log in, and if
you set PATH there it will override the path defined in
/etc/default/login. When you "su", .profile is not executed and path
remains as it was defined in /etc/default/su. IMHO, login and su
files in /etc/default directory (in combination with
/etc/dt/config/Xconfig file) are much better place to put system wide
default path than shell initializaiton files (like /etc/profile for
example) because it works for all login shells.
Opinions expressed herein are my own.
Statements included here may be fiction rather than truth.