LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Adding an entry to the PATH (https://www.linuxquestions.org/questions/solaris-opensolaris-20/adding-an-entry-to-the-path-96390/)

Pimple 09-24-2003 02:09 PM

Adding an entry to the PATH
 
How do I add an entry to the PATH in Solaris 8. I want to add an entry for Netscape Communicator. Thanks!!

trickykid 09-24-2003 03:59 PM

Easiest way is to either edit the user's profile either if they using korn as their shell or bash, you'd want to add the path in their; kshrc or bashrc file, depending on what shell of course.
Or you can add it to the global file, /etc/profile

osprey0331 09-24-2003 05:15 PM

it is faster to add a soft link in the /usr/sbin, which will then be accessible to all users. To do this, become su and cd into /usr/sbin. then type

ln -s /opt/netscape/netscape netscape and then press enter.

this will put a link to the executable into the global path, as all users can get to /usr/sbin, and assumes that you installed netscape in the default location. Otherwise, substitute the absolute path of the netscape executable for what i have typed.

otherwise, as trickykid said, the best place to declare the PATH variable is in one of the .profiles, or rc files, followed by the global profile

Pimple 09-24-2003 09:56 PM

Thanks guys. I kept digging on Google while I was waiting for a response and came up with:
env -i PATH=/opt/NTSPcom

Is that an alternative to what you all suggested or do I still need to set the path using one of your methods?

trickykid 09-25-2003 12:18 AM

Quote:

Originally posted by Pimple
Thanks guys. I kept digging on Google while I was waiting for a response and came up with:
env -i PATH=/opt/NTSPcom

Is that an alternative to what you all suggested or do I still need to set the path using one of your methods?

The way you set the path will only be temporary. If you want the path to be permanent each time you login, you need to add it to your profile or users bashrc or kshrc files in their home directories.
I personally wouldn't setup a symlink, that can get messy. Also adding the directory in your path could make it easier for other programs or commands in the same directory to be executable instead of typing the full path or adding a dozen or so symlinks.

Pimple 09-25-2003 12:38 PM

I found a file in the Home directory called .dtprofile.
Is this the file and do I add:
PATH=/opt/NTSPcom

after the last line in the file?

Pimple 09-25-2003 12:40 PM

there is also a file called .cshrc


All times are GMT -5. The time now is 06:26 AM.