LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   PATH setting problem in Solaris 10 (https://www.linuxquestions.org/questions/solaris-opensolaris-20/path-setting-problem-in-solaris-10-a-875797/)

ddegif 04-19-2011 01:39 AM

PATH setting problem in Solaris 10
 
I have solaris 10 u9 installed, I as using default bash shell. I have tried to set a new PATH value by the following command
PATH=$PATH:/whtever/I/need
but I concede the variable is not persist in boot time even in closing a terminal.

So I enforced to ask u guys, how can I set environmental variable in Solaris which does not made u to do it again and again!!!

THX all of u , which will show ur faces for a help!!!

bathory 04-19-2011 02:28 AM

Hi,

You can set the new PATH in ~/.profile

Regards

ddegif 04-19-2011 02:45 AM

Is there a way to done it on command line? there is and to specify exactly wht is the command? I have tried to export using "export" and nothing is changed. And if someone know at minimum the files that are affected is encouraged

bathory 04-19-2011 03:24 AM

You can put in ~/.profile:
Code:

export PATH=$PATH:/whtever/I/need
After that you have to logout/login again, or run
Code:

source ~/.profile
for the changes to take effect.
Note that no files are affected, since env. variables are stored in memory

ddegif 04-19-2011 03:41 AM

I am on root account and, there is no a file ~/.profile under /(root). and does I have to create it? if I have to, I have fears on setting environments perfectly. so wht should I do next?

bathory 04-19-2011 04:05 AM

If it doesn't exist, sure you need to create it.
If you fear to break something, open another terminal as root, create the .profile, source it and see if it works as expected. If something goes wrong and you can't unset the PATH, go to the previous terminal and delete .profile (or comment out the export statement).


All times are GMT -5. The time now is 11:17 PM.