1827756 Members
2932 Online
109969 Solutions
New Discussion

path question

 
Jeffrey F. Goldsmith
Super Advisor

path question

I have a very basic question. Once I had re-installed HP-UX 11.i on to my D380 server I wasn't sure how to finish setting it up. What I mean by that is how do I make changes to the path so that I can get programs to run from the root. For example I have HP OV DP installed on the server. When I want to stop the program I end up having to search the drive to find out where the program is and then go to that directory and stop the program. I want to be able to do that from any directory that I am currently in.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: path question

The standard method is to edit the file /etc/PATH but you can also edit a given user's .profile

e.g.

PATH=/myextradir/bin:${PATH}
export PATH
If it ain't broke, I can fix that.
Mic V.
Esteemed Contributor

Re: path question

Assuming that root's shell has not been changed (it's recommended that you never change it), you should make the above change to /.profile to alter only root's login.

FYI, you don't have to cd to a directory in order to run a program (although it seems easier). Instead of

find / -name myprog
cd /path/above/myprog
./myprog

you could:

find / -name myprog
/path/above/myprog/myprog

Another useful thing is to keep a little file or log for yourself of helpful stuff -- stuff you keep having to look up. :-)

HTH.
What kind of a name is 'Wolverine'?
Bill Hassell
Honored Contributor

Re: path question

The OpenView pakage should have added the OV DP path to /etc/PATH. If it is located in that file, then the method you use to login is bypassing /etc/profile, or someone has removed the /etc/PATH code from /etc/profile.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: path question

Little PATH advice.

Take a little look at the order of the path statement.

I had a single user that scould not scp.

Kept saying options like -p or -rp were invalid.

Scratched my head for a while on it. Searched forums for the message. Didn't write a thread though.

Finally the user asked why scp didn't work for him and everybody else had it.

So reluctantly, I filed a support case on Friday. They never heard of the error message and kicked the call up to backline support.

They asked for a bunch of information. While gathering it, it occurred to me to run the command:

whence scp

I was thinking maybe somehow another scp or openssh release was on the box.

No, there was another program called scp installed with a cobol compiler that only that user used. It was first on the path. Ooops.

So if after modifying the path something strange happens, take a little look along the path as to where the binary is. You may be surprised.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Gordon  Morrison
Trusted Contributor

Re: path question

Rather than changing PATH, have you considered using alias?
e.g. syntax for posix/ksh , add to .profile:

alias myprog=/full/path/to/myprog
What does this button do?