I have edited /etc/profile but the path only gets changed for normal users whereas the change does not reflect for root, how can I make it such that the path also gets changed for root?
Asked
Active
Viewed 1.2k times
2 Answers
2
On Solaris, regular users and root default PATH are defined in /etc/default/login
and /etc/default/su
in the PATH & SUPATH variables.

jlliagre
- 29,783
- 6
- 61
- 72
-
so does that mean I would have to include PATH=$PATH:/new/path export PATH inside /etc/default/su? – shawn Feb 20 '12 at 02:54
-
No. /etc/default/su isn't a shell script but a file defining initial settings whatever the shell is. $PATH would mean nothing here. Of course, further scripts like /etc/profile and $HOME/.profile can alter this initial setting. – jlliagre Feb 20 '12 at 06:41
0
root uses a different shell from everybody else; or very definitely should: /bin/sh If you used bash/ksh syntax:
export PATH=${PATH}:/new/path1:/new/path2
...will not work.
PATH=${PATH}:/new/path1:/new/path2
export PATH
This fits /bin/sh syntax

jim mcnamara
- 16,005
- 2
- 34
- 51