just saying - hi [ how to set path in solaris permanently ]
hi all,
this is arvind from india. I have a question regarding solaris. # how to set or export path on permanent basis ? I know PATH=.. and export PATH but it works temporaray,once you restart or logout,you will get old path or by default. So i need help.Actually i want to set path for perl in solaris 10. thanks Arvind |
well that's *not* just saying hi.. that's asking a solaris question. so moved to SOlaris forum.
|
You have two choices - system-wide or user.
System-wide; i.e., so every user logging on to the system gets the PATH, add a line in /etc/profile like this: Code:
PATH=${PATH}:/path-to-application-executable Code:
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path-to-application-libraries You can add multiple lines as shown in /etc/profile or ~/.profile. If you're using C-Shell, you would put the .profile entry in .login (using C-Shell syntax). |
Additionaly, you can set the initial users and root PATH in /etc/default/login and /etc/default/su (PATH & SUPATH).
|
thank.. i will try it and let you know.
regards arvind |
*** DIGGING UP AN OLD POST to a NEW QUESTION ***
I have been looking for where the best place to add to the PATH environment and saw that while editing /etc/X11/gdm/PreSession/DEFAULT there is an alteration to PATH there. I edited it, logged out and back in again, but that didn't do it. Then I went searching and found this post. I tried tronayne's answer, but that didn't work either (/etc/profile). I don't have a .profile on the system anywhere. I don't want to create a new entry, I just want to edit what is already there. Additionally, my path is not set in either of the locations that jlliagre has indicated (the lines are commented out). Where can I find where PATH is set? edit: I have actually gone and created the .profile file in my home directory (it wasn't there - no, it wasn't hidden, it's just not there in ls -al) and added the lines: Code:
dave@solaris:~# cat .profile |
Quote:
|
madivad, Do NOT dig up old thread for new questions, that's *EXACTLY* what you shouldn't do, in it's most refined and purest form... new question = new thread.
|
Quote:
Should that still be a new thread? I was also trying to show that I had searched forums before posting, but your comment has been taken on board |
OK, once more into the breech: in /etc/profile or ${HOME}/.profile, define an environment variable; e.g., EDITOR=/usr/bin/vi, then export that variable into the environment; i.e., export EDITOR.
Adding on to a previously-defined environment variable: PATH=${PATH}:/usr/local/bin and so on. Use a previously-defined environment variable: e.g., MYSQLDIR, PATH=${PATH}:${MYSQLDIR}/bin. If you make any changes in /etc/profile, you must log out and log back in for them to take effect; similarly, if you make changes in your home directory .profile, you ought to log out and log back in for them to take effect. Oh, yeah, try reading man profile too. Are you using C-shell, by any chance? If you are, then a ${HOME}/.profile will do nothing. C-shell (if so, you have my sympathy by the way) does these same things in /etc/profile for every user then in ${HOME}/.login and ${HOME}/.cshrc. To set the path environment variable in ${HOME}/.login, you use something like this Code:
set path = ( $path /usr/local/bin ) |
Madivad, did you test my previous suggestion ?
http://www.linuxquestions.org/questi...34#post3095734 |
Make sure that user who is going to use .profile is using /bin/sh SHELL.
To verify that check /etc/passwd. |
Please don't advise using /bin/sh which is a pain under Solaris. Suggest using /bin/ksh or /bin/bash instead. They use .profile the same way.
/etc/default/login PATH variable is the place to set the initial PATH regardless of what shell is used. |
I have tried everyones suggestions so far and it's becoming an awful mess. So far, nothing is working and I thought I would recap.
I am using OpenSolaris and it's the fancy gnome desktop, not the CDE of Solaris (if this makes a difference) I have tried uncommenting where PATH has been previously commented out I have created .login and .profile files in my home dir I have edited /etc/default/login After EVERY edit I always log out and back in again and this is ALWAYS the result: Code:
dave@solaris:~$ set | grep PATH edit: I have come to the conclusion that at some final stage PATH is being set somewhere without inheriting the existing path. But I am at my wits end trying to find where this is happening |
Quote:
Quote:
~/.bashrc /etc/bash.bashrc |
All times are GMT -5. The time now is 06:15 PM. |