On Slackware Linux, when I want to set an environment variable I edit this file

vim /etc/environment

On Solaris11, I can set a PATH with nonstandard dirs with those commands(I test the commands in the path with ssh without using the user-environment option and works fine)

svccfg -s svc:/system/environment:init setprop environment/PATH = astring: "/sbin:/bin:/usr/sbin:/usr/bin:/opt/gm/bin:/opt/gm/sbin:/usr/local/bin:/usr/local/sbin" 
svccfg -s svc:/system/environment:init refresh

I still don't understand how to set a variable like this on Hp-ux, please don' answer edit /etc/PATH or edit /etc/profile because I had already tried it and doesn't work.

1 Answer 1


I was confused by sshd because without the user environment option set to no doesn't found my files in /usr/local/bin even when I set correctly the variable PATH in /etc/profile and /etc/PATH. If I compile ssh with


in configure, found my files in /usr/local/bin So I think the correct answer is /etc/profile and /etc/PATH to initialize environment(if you want to pass other variables to programs must edit /etc/rc.config.d/nameprogram or the init script of the program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .