Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying root's environmental path

Andrew Kaplan
Super Advisor

Modifying root's environmental path

The root user on one of our 10.20 machines is using the sh shell. I wanted to modify the PATH in order to accomodate a program that was install in the /opt/vnc directory. Vnc is the name of the program. I went to the .profile file and modified the .PATH statement to include the path to the application directory. After logging out and logging back into the system, I attempted to start the application but got an error which said a particular file was not found in my path statement. When I did an echo $PATH, the directory was not listed. What did I miss? Thanks.
A Journey In The Quest Of Knowledge
7 REPLIES
Leif Halvarsson_2
Honored Contributor

Re: Modifying root's environmental path

Hi,
Do you use CDE ? In this case you must use the .dtprofile for enviroment settings or (in this file) uncomment the line
# DTSOURCEPROFILE=true
Sridhar Bhaskarla
Honored Contributor

Re: Modifying root's environmental path

Hi,

Dot in the .profile and see if it works.

#cd
#. ./.profile
#echo $PATH

If you are using CDE, you will need to make sure that, in $HOME/.dtprofile the line "DTSOURCEPROFILE=true" is uncommented.
Keep a file called $HOME/.Xdefaults that has the line "dtterm*loginShell: True".

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Andrew Kaplan
Super Advisor

Re: Modifying root's environmental path

Hi there,

Yes...CDE is used as our GUI desktop. If I understand you correctly, the PATH statement in .dtprofile should be modified accordingly, and the last line in the file should be uncommented. Is that correct?
A Journey In The Quest Of Knowledge
harry d brown jr
Honored Contributor

Re: Modifying root's environmental path

Check the home of root's .profile:

login as root
cd
grep -i PATH .profile

and

grep -i PATH /etc/profile

live free or die
harry
Live Free or Die
Sridhar Bhaskarla
Honored Contributor

Re: Modifying root's environmental path

No. You don't specify PATH statement in .dtprofile. You enable .profile to run through .dtprofile. YOu will need to make sure you have .Xdefaults file as I mentioned before.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Shannon Petry
Honored Contributor

Re: Modifying root's environmental path

You can also add the directory to /etc/PATH, /etc/profile, and for C-Shell, /etc/csh.login. All of these will give a global definition.

With root though, I change the paths in /.profile, and /.cshrc for cshell. I have no problems in CDE with this, even though I dont uncomment the line in .dtprofile. At initial login, your defaults are read, just not each consecuative shell afterwards.

Regards,
Shannon
Microsoft. When do you want a virus today?
James R. Ferguson
Acclaimed Contributor

Re: Modifying root's environmental path

Hi Andrew:

Adding additional levels to the PATH variable is sometimes appropriate. Make sure that you keep the most likely directories to contain the desired object at the front of the PATH for optimal search times.

In some cases, it is just as appropriate to code (or force the use of) an absolute path in a script or command line.

Regards!

...JRF...