Operating System - HP-UX
1834346 Members
2193 Online
110066 Solutions
New Discussion

where to modify the path of the executables

 
subrata  Sur
Frequent Advisor

where to modify the path of the executables

when i m typing sx7 on my unix hp server it will open the application .

I have typed which sx7 it will give /usr/bin/sx7

I want to mdify the path of the executable Can u plz guide me where to change the path ...
Thanx
with regads
Subrata Kr Sur
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: where to modify the path of the executables

mv /usr/bin/sx7 /xxx/yyy/zzz/

Now you need to modify your PATH environment to look in the /xxx/yyy/zzz directory.

On a global basis, you can edit /etc/PATH and add :/xxx/yyy/zzz to the list that is already there.

You can also modify PATH in /etc/profile or you can modify .profile in your home directory:

Something like this:
PATH=${PATH}:/xxx/yyy/zzz
export PATH
If it ain't broke, I can fix that.
Raj D.
Honored Contributor

Re: where to modify the path of the executables

Hi Subrata ,

1. You can move the executable to another location and edit the path .

2. You can also create a link for that , in the new path.

Ex: 1.
# mv /usr/sbin/sx7 /yourdesired_dir/sx7
# vi /etc/PATH
( Include the new path )

or
# edit .profile of that user , who will be using the executable , and put the path.

Ex.2 .
# cd /yourdesired_dir/
# ln /usr/sbin/sx7 .
Add the path.

Cheers,
hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
subrata  Sur
Frequent Advisor

Re: where to modify the path of the executables

ThanK you For ur info ...

Let me ask another confusion I have kept the script sx7 in different directory ... and all the path i have updated in $PATH directory in . profile file So which sript it will execute first ....
A. Clay Stephenson
Acclaimed Contributor

Re: where to modify the path of the executables

Do a "type sx7" for the answer. The PATH is searched in order from first to last so the first match wins unless you specify an absolute pathname.
If it ain't broke, I can fix that.