Permanent changes to PATH

Hi guys,

I'm running Solars 8 on a V100 server at home for testing.
If I switch user to root and do:

# echo $PATH

This is the output:

/usr/sbin:/usr/bin

I'm using rsync over ssh and need to add /usr/local/bin and /user/local/sbin.

I do this by running the line:

# PATH=/usr/sbin:/usr/bin:/usr/local/bin:/user/local/sbin

And it runs fine until reboot. Can someone please tell me how to make this change permanet?

Thanks in anticipation.

Stin

add the following like to your .profile. This should do it for you.

export PATH=/usr/sbin:/usr/bin:/usr/local/bin:/user/local/sbin

keep in mind that if you write cron jobs, the .profile is not run when the cron job fires, so you will either have to hard code your paths or source in the .profile to each shell script you put in there.

Exporting PATH won't work. When you switch to root using the su command, your PATH is reset to a default value which is /bin:/sbin.
You can modify this default value by changing SUPATH the /etc/default/su file.

Thanks guys! All sorted now.