1830486 Members
2623 Online
110005 Solutions
New Discussion

$PATH not being read??

 
Mary Ann Lipa
Valued Contributor

$PATH not being read??

Hi,
please help...
i have an executable named 'pong' :
# whereis pong
pong: /usr/local/bin/pong /opt/seri/bin/pong

i am logged in as root [on console and remotely via reflection1]
[.profile]
PATH=/usr/sbin:$PATH:/sbin:/home/root:/opt/seri/bin/

when i execute on local console, this is what i get [which is correct]
# pong server1
'server1' SERI is alive (channels: 4 maximum; 4 free)
'server1' SERI version = 3.0/0 for HP-UX B.11.00

when i execute on remote connection [logged in via reflection1, as root]
# pong server1
sh: pong: not found.
# whereis pong
pong: /usr/local/bin/pong /opt/seri/bin/pong

if i will execute using the absolute path, the command will work...

Where else do i need to look?
Please help..

Thank you...
ann
Which is worse, smoking or picking your nose in a public place?
12 REPLIES 12
John Carr_2
Honored Contributor

Re: $PATH not being read??

Ann

try

echo $PATH

to find out what your path is when logged in for starters

John.
Joseph Loo
Honored Contributor

Re: $PATH not being read??

hi,

try:

# echo $PATH|grep local
any output, if not, it means /usr/local/bin is not in the PATH.

if you need it in the PATH, edit your .profile to include.

regards.
what you do not see does not mean you should not believe
Bharat Katkar
Honored Contributor

Re: $PATH not being read??

See if you are using bash shell then you need to set the path in .bashrc of root in order to inherit that PATH varible in reflectionX session.

If it is C shell then do it in .cshrc
For psoix it is .shrc
Hope this solves your problem.

You need to know a lot to actually know how little you know
Mary Ann Lipa
Valued Contributor

Re: $PATH not being read??

thanks guys!
am checking on it, will update yous once i was able to log in...
Thanks again!
ann
Which is worse, smoking or picking your nose in a public place?
Mark Grant
Honored Contributor

Re: $PATH not being read??

Your .profile isn't being read by your refelctions session. You will probably need to set the PATH in your X startup file as well or, if using CDE you need to set "DTSOURCEPROFILE=true" in /usr/dt/config/sys.dtprofile.
Never preceed any demonstration with anything more predictive than "watch this"
KapilRaj
Honored Contributor

Re: $PATH not being read??

Is there a file called $HOME/.dtprofile ?

Regds,

Kaps
Nothing is impossible
Mary Ann Lipa
Valued Contributor

Re: $PATH not being read??

on my CDE session:
# echo $PATH
/usr/sbin:/bin:/usr/bin:/usr/dt/bin:/usr/bin/X11:/sbin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/usr/contrib/kwdb/bin:/opt/upgrade/bin:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/ipf/bin:/opt/resmon/bin:/opt/sec_mgmt/bastille/bin:/opt/gnome/bin:/opt/perf/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/mozilla:/opt/Netscape:/opt/mx/bin:/opt/sec_mgmt/spc/bin:/opt/ignite/bin
# whoami
root
# who am i
# echo $SHELL
/sbin/sh

on console:
echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/usr/contrib/kwdb/bin:/opt/upgrade/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/ipf/bin:/opt/resmon/bin:/opt/sec_mgmt/bastille/bin:/opt/gnome/bin:/opt/perf/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/mozilla:/opt/Netscape:/opt/mx/bin:/opt/sec_mgmt/spc/bin:/opt/ignite/bin:/sbin:/home/root:/opt/seri/bin/
# whoami
root
# who am i
# echo $SHELL
/sbin/sh


please help....
thanks!!!
ann
Which is worse, smoking or picking your nose in a public place?
Joseph Loo
Honored Contributor

Re: $PATH not being read??

hi,

as mentioned, edit .profile, and insert ":/usr/local/bin" to the end of the PATH variable, i.e.

PATH=/usr/sbin:$PATH:/sbin:/home/root:/opt/seri/bin/:/usr/local/bin

logout and login again.

regards.
what you do not see does not mean you should not believe
Robert-Jan Goossens
Honored Contributor

Re: $PATH not being read??

Hi Ann,

Check your $HOME/.dtprofile for the last line, should be uncommented.

DTSOURCEPROFILE=true

Hope this helps,
Robert-Jan
John Carr_2
Honored Contributor

Re: $PATH not being read??

Ann

technicall you are not loggin as root you are running an X session as root. The paths you have shown us is that of an Xsession.

cd ~
grep /usr/bin/X11 .*

this will tell you which file the PATH is being extracted from by comapring the output paths with your path from the command line, once you know this you can append one of the two paths to pong.

:-) John.
Mary Ann Lipa
Valued Contributor

Re: $PATH not being read??

Thank you guys!!!
its working now!!

really appreciated all the help!!!

you all rock!

ann
Which is worse, smoking or picking your nose in a public place?
Dani Seely
Valued Contributor

Re: $PATH not being read??

Hey Ann,
Your PATH needs to be updated and Joseph Loo
provided the correct information on updating your profile, however, you don't ahve to logout and login again. You can just source your profile after you make the change, i.e.
# . ./.profile

Best of luck!
Together We Stand!