just saying - hi [ how to set path in solaris permanently ]
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Alternatively, do the same in the .profile file in your home directory; note, however, that you must log out and log back in again for any change to take effect (/etc/profile and your home directory .profile are read once when you login).
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).
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:
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.
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.
My appologies. I wasn't thinking too straight. It SHOULD have read "Digging up an old thread - SAME question" as it is in fact the SAME question.
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
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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 )
That's the extent of my C-shell knowledge and setting environment variables for it; try man csh if that's the case.
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
MANPATH=/usr/gnu/share/man:/usr/share/man:/usr/X11/share/man
PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin
dave@solaris:~# set | grep PATH
MANPATH=/usr/gnu/share/man:/usr/share/man:/usr/X11/share/man
PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin
To test I am doing the above in a terminal window
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
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by madivad
I am using OpenSolaris and it's the fancy gnome desktop, not the CDE of Solaris (if this makes a difference)
Can you post the content of /etc/release to clarify ?
Quote:
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
Did you look at the bash files ?
~/.bashrc
/etc/bash.bashrc
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.