- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Full Path needed to execute a command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 11:54 AM
10-25-2001 11:54 AM
/sbin/sh: command_name: not found
I had to exit out my path all the way to the top and then type in the full path of the command to be able to execute it.
What's the reason and how do I fix this?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 11:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:00 PM
10-25-2001 12:00 PM
Re: Full Path needed to execute a command
./
eg:
# cd /dirA/test
# ./runprogram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:00 PM
10-25-2001 12:00 PM
Re: Full Path needed to execute a command
Let's say the command was this:
something.sh
Did you type in
something.sh
and it did not execute? or did you enter in this:
./something.sh
The full path
/opt/whatever/something.sh
will always work. Of course you have to have execute permissions set on something.sh.
live free or die
harry
ps: You could add the current working directory to your PATH variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:02 PM
10-25-2001 12:02 PM
Re: Full Path needed to execute a command
#which
if the out output returns saying "no
1) add the path your command is in:
#export PATH=$PATH:
2)execute using the absolute path:
#/path/foryour/command
3)from inside the directory
#./command
Also make sre it's executable (just a thought.
Hope this helps.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:04 PM
10-25-2001 12:04 PM
Re: Full Path needed to execute a command
Like others have mentioned you can use ./command. If that does not work you can also use $PWD/command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:10 PM
10-25-2001 12:10 PM
Re: Full Path needed to execute a command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 12:13 PM
10-25-2001 12:13 PM
Re: Full Path needed to execute a command
1 - you specify the absolute patch (starting with /) to the command
2 - you specify a relative path (relative from your current directory) such as ./command or ../command or subdir/command
3 - or you specify a simple pathname (just the command name without anything else) and it is found in one of the directories specified in you $PATH variable.
So to fix this, either:
1 - cd to the directory and run the command as ./command
2 - set your PATH manually after you login to include the current (.) directory using export PATH=$PATH:.
3 - set your PATH automatically whenever you login by putting export PATH=$PATH:. in your .profile
4 - you could add . to the PATH variable in /etc/profile but some people consider that a security violation.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 04:26 PM
10-25-2001 04:26 PM
Re: Full Path needed to execute a command
Here's what can happen: Someone places a file in /tmp and calls it su. You cd into /tmp and after a while, you type su. If your $PATH contains :: or :.: then this rogue program or script will be executed--and your password will be stolen.
So your system administrator decided that the current working directory should not be searched unless you take extra steps (the ./) to run the program.
Bill Hassell, sysadmin