Operating System - HP-UX
1833883 Members
1714 Online
110063 Solutions
New Discussion

Over write PATH with /etc/PATH

 
SOLVED
Go to solution
Alexander E Jackson
Occasional Contributor

Over write PATH with /etc/PATH

I loaded HPUX 10.2 a few weeks ago. I configured the /etc/profile to add /usr/sbin to the PATH list and exported PATH. In addition, I added the same change to the .profile or .cshrc of every user on the system. The problem that I am having is that the /usr/sbin is not showing up when the echo $PATH is given. An echo to $PATH displays many different directories that most users probably would not use in a life time such as /usr/dt/bin or /usr/local/bin/X11 or whatever. I frankly don't know where these other PATH names are being assigned. One friend pointed out to me that /etc/PATH file holds the key to all the PATH's. But, HPUX 10.2 doesn't have a /etc/PATH file. So first, where do all the entries come from in $PATH? Second and most important, How can I get the enteries that are posted in the .profile and the .cshrc to be recognized over the existing PATH or how does implement /etc/PATH file?

Thanks to all that respond.
3 REPLIES 3
Pete Randall
Outstanding Contributor
Solution

Re: Over write PATH with /etc/PATH

In /etc/profile, the following statement sets up the standard PATH:

export PATH=`cat /etc/PATH`

/etc/PATH is simply a text file containing normal PATH entries.


Pete

Pete
Rick Garland
Honored Contributor

Re: Over write PATH with /etc/PATH

In the individual .profile files,
export PATH=$PATH:/home:/

The $PATH in the above line references the /etc/profile PATH listing.
Kent Ostby
Honored Contributor

Re: Over write PATH with /etc/PATH

Alexander --

A user could specify their own PATH in their .profile without referencing the system's setting for $PATH.

So if you want to add /home/bin to your path in the .profile, it should be:

PATH=$PATH:/home/bin

Some user may have done:

PATH=/home/bin

Or even if they just left out the $

PATH=PATH:/home/bin

This will look for two directories PATH and /home/bin.

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"