1830226 Members
1613 Online
109999 Solutions
New Discussion

execute command

 
SOLVED
Go to solution
Jade Bulante
Frequent Advisor

execute command

I installed a program called pgp in one of the main directories but in order for me to run the program, I have to go to the directory where it is installed and issue ./pgp.

Can I have it as part of my profile so that I can issue the command from any directory or folder.

Let me know if you can help.
8 REPLIES 8
Eileen Millen
Trusted Contributor
Solution

Re: execute command

You can add the directory to a PATH statement in your .profile file
PATH=$PATH:/directory_path
Jade Bulante
Frequent Advisor

Re: execute command

I edited the .profile to include correct path but I get this error.

"/usr/bin/sh:pgp not found"

Eileen Millen
Trusted Contributor

Re: execute command

Ron's answer in the profile message is right.
I didn't think about having to do
. ./.profile to get it to run.

PATH=$PATH:/new_path
would also work
Shahul
Esteemed Contributor

Re: execute command


Hi

Before editting .profile U acn try this.
#PATH=$PATH:/"pgp programs path"
#export PATH
#pgp (regardless of where U are). If this is working U can add the same thing in $home/.profile file. If this is not working Ur program has got some other problem. Come out with more inputs.

Shahul
Ravi_8
Honored Contributor

Re: execute command

hi,
add it in PATH
#PATH=$PATH:/newpath.
newpath is the path where your .prg exist
eg : if prg exist in /x/y/prg
then #PATH=$PATH:/x/y
#export $PATH
or same thing can be added in .profile file
never give up
Herve BRANGIER
Respected Contributor

Re: execute command

Hi Jade,

Like others said you can add the path (when
you change directory typing "cd /A/B/C", your
path is "/A/B/C" or use "pwd" to be sure when
you are in your program's directory).

Type in a shell to verify and add to your
.profile : export PATH=$PATH:YOUR_PATH

I use another method : I have a $HOME/bin
directory (a bin directory in my home dir)
where I put all my prg or I make links (using
ln -s / $HOME/bin/).
And I added $HOME/bin in my path like we describe
for your own prg.

HTH

Herve



Rainer von Bongartz
Honored Contributor

Re: execute command



Look at the file /etc/PATH

you could edit this file which will give eryone logging into this system the new $PATH
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Bill McNAMARA_1
Honored Contributor

Re: execute command

For CDE, as it doesn't automatically source your .profile on dtterm launch, you might want to edit the system profiles to ensure that your dt config sources profile on login.
see /etc/dt/config/sys.dtprofile (/usr/dt/config) and set DTSOURCEPROFILE=true

Later,
Bill
It works for me (tm)