Operating System - HP-UX
1826073 Members
3718 Online
109690 Solutions
New Discussion

Re: How to Troubleshoot commands that fails

 
SOLVED
Go to solution
Ricky B. Nino
Frequent Advisor

How to Troubleshoot commands that fails

Hi,

Just recently have experienced issuing a command in my system that works before and now it fails. The error message is ... NOT FOUND!

for example...
# make_tape_recovery -Av

After a system reboot it works again.

Anyways I can find the root cause and fix the problem without system reboot?

regards...
Opportunities expand for people willing to put time and effort into learning new skills.
9 REPLIES 9
S.K. Chan
Honored Contributor
Solution

Re: How to Troubleshoot commands that fails

Most of the time it's due to the $PATH environment var that does not have the directory path of where "make_tape_recovery" command is located .. hence the error NOT FOUND. For instance in this example, make_tape_recovery is in /opt/ignite/bin, check $PATH and see if /opt/ignite/bin is included in the path.
# env|grep PATH
Look for something like ..
..
PATH=/bin:/usr/bin:..
....
If it's not there (the path), you got to include it in root's profile. Another possibility is if you are already in the directory /opt/ignite/bin then it should be run like so ..
# ./make_tape_recovery
that is with a "./" in front of it.
Michael Tully
Honored Contributor

Re: How to Troubleshoot commands that fails

You will find that the command is not in your path and most likely not in the default system path i.e. /etc/PATH

To check:
# echo $PATH

You can use the 'whereis' command to find programs etc.

Add it to the default system path or you can add it as you need it.
# PATH=$PATH:/opt/ignite/bin ; export PATH
Anyone for a Mutiny ?
Manju Kampli
Trusted Contributor

Re: How to Troubleshoot commands that fails

command not found error is due to the fact that the system could not find the command with in the search PATH .. there are two ways you can solve it .. use the full path when running command
i.e. /opt/ignite/bin/make_recovery ... OR
in your home dir edit .profile and add the /opt/ignite/bin to the PATH variable

The second option is preferred as it will keep this permanent and you don't have to type the full path again and again.
HTH
Manju
Never stop "LEARNING"
Ricky B. Nino
Frequent Advisor

Re: How to Troubleshoot commands that fails

Guys,

1. Aside from intentionally/ accidentally changing the PATH variable any possible reason/s why PATH have changed?

Have not changed the PATH when I encountered the problem. Just rebooted the system then everything goes well.

2. Is the man pages related to this kind of problem?

thanks...
Opportunities expand for people willing to put time and effort into learning new skills.
RAC_1
Honored Contributor

Re: How to Troubleshoot commands that fails

you can define path from /etc/profile or in /etc/PATH file. now check if have some issues with that.

do not know if both are present and varies then which one takes precedence?.

There is no substitute to HARDWORK
Manju Kampli
Trusted Contributor

Re: How to Troubleshoot commands that fails

Hello Ricky,

If you haven't changed any thing and command worked after the reboot does not make sense..

did you update the PATH in .profile and run the command with out logout and login .. The reboot would have done this ..
Once you change the .profile you need to logout and login again to take the effect OR execute it using ". ./.profile" from your home directory

- Manju
Never stop "LEARNING"
Ricky B. Nino
Frequent Advisor

Re: How to Troubleshoot commands that fails

Hi Manju,

As I have mentioned I really never did anything prior and after my system reboot to the PATH variable.

Anyways, many thanks for the ideas...
Opportunities expand for people willing to put time and effort into learning new skills.
John Meissner
Esteemed Contributor

Re: How to Troubleshoot commands that fails

if you type:
#command
and it doesn't work... try:
#./command
if it works that time then you need to enter the "." (pwd) into your path statement. Wheather or not you did something to your .profile doesn't mean that someone else didn't .
All paths lead to destiny
Jean-Louis Phelix
Honored Contributor

Re: How to Troubleshoot commands that fails

Hi,

In fact I agree with you, if nothing has changed on your system, the "static" configuration defined in /etc/PATH, /etc/profile or $HOME/.profile should be good. So, first try should have been to logout and login to see if a script which could modify you $PATH had been sourced using a '.' command.

Regards.
It works for me (© Bill McNAMARA ...)