<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Full Path needed to execute a command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601600#M34384</link>
    <description>Hi.&lt;BR /&gt;&lt;BR /&gt;Like others have mentioned you can use ./command. If that does not work you can also use $PWD/command.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 25 Oct 2001 19:04:58 GMT</pubDate>
    <dc:creator>G. Vrijhoeven</dc:creator>
    <dc:date>2001-10-25T19:04:58Z</dc:date>
    <item>
      <title>Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601595#M34379</link>
      <description>Hi, I couldn't execute a command even I am already inside the path. The error message was: &lt;BR /&gt;&lt;BR /&gt;/sbin/sh: command_name:  not found&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;What's the reason and how do I fix this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Thu, 25 Oct 2001 18:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601595#M34379</guid>
      <dc:creator>Jenny C</dc:creator>
      <dc:date>2001-10-25T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601596#M34380</link>
      <description>If you put   ./command_name&lt;BR /&gt;it should work.&lt;BR /&gt;for the .profile file to run you would put&lt;BR /&gt;. .profile&lt;BR /&gt;&lt;BR /&gt;Otherwise, you would have to put the path in your .profile file in the PATH statement.&lt;BR /&gt;&lt;BR /&gt;Eileen</description>
      <pubDate>Thu, 25 Oct 2001 18:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601596#M34380</guid>
      <dc:creator>Eileen Millen</dc:creator>
      <dc:date>2001-10-25T18:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601597#M34381</link>
      <description>If you're in the directory already type&lt;BR /&gt;  &lt;BR /&gt;     ./&lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;eg: &lt;BR /&gt;      # cd /dirA/test&lt;BR /&gt;      # ./runprogram&lt;/FILE&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:00:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601597#M34381</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2001-10-25T19:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601598#M34382</link>
      <description>&lt;BR /&gt;Let's say the command was this:&lt;BR /&gt;&lt;BR /&gt;something.sh&lt;BR /&gt;&lt;BR /&gt;Did you type in &lt;BR /&gt;&lt;BR /&gt;something.sh&lt;BR /&gt;&lt;BR /&gt;and it did not execute? or did you enter in this:&lt;BR /&gt;&lt;BR /&gt;./something.sh&lt;BR /&gt;&lt;BR /&gt;The full path&lt;BR /&gt;&lt;BR /&gt;/opt/whatever/something.sh&lt;BR /&gt;&lt;BR /&gt;will always work. Of course you have to have execute permissions set on something.sh.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;&lt;BR /&gt;harry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ps: You could add the current working directory to your PATH variable.&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:00:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601598#M34382</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-10-25T19:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601599#M34383</link>
      <description>It is possible that the command that you entered is not in you PATH variable.  type in the following:&lt;BR /&gt;&lt;BR /&gt;#which &lt;COMMAND&gt;&lt;BR /&gt;&lt;BR /&gt;if the out output returns saying "no &lt;COMMAND&gt; in ... (list of paths)", then you have to do one, or all of the following:&lt;BR /&gt;&lt;BR /&gt;1) add the path your command is in:&lt;BR /&gt;#export PATH=$PATH:&lt;/COMMAND&gt;. also add it to your .profile&lt;BR /&gt;&lt;BR /&gt;2)execute using the absolute path:&lt;BR /&gt;#/path/foryour/command&lt;BR /&gt;&lt;BR /&gt;3)from inside the directory&lt;BR /&gt;#./command&lt;BR /&gt;&lt;BR /&gt;Also make sre it's executable (just a thought.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;BR /&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:02:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601599#M34383</guid>
      <dc:creator>Christopher McCray_1</dc:creator>
      <dc:date>2001-10-25T19:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601600#M34384</link>
      <description>Hi.&lt;BR /&gt;&lt;BR /&gt;Like others have mentioned you can use ./command. If that does not work you can also use $PWD/command.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:04:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601600#M34384</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2001-10-25T19:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601601#M34385</link>
      <description>Thank you all very much for the quick replies.  I really appreciate it.  The command worked!  I am on my way to learn the simplist things of unix and I might see you again down the road. &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:10:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601601#M34385</guid>
      <dc:creator>Jenny C</dc:creator>
      <dc:date>2001-10-25T19:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601602#M34386</link>
      <description>Unlike some OSes, if you don't explicitly tell the shell where to find a command (using absolute or relative pathnames), UNIX will only look in the directories you specify with the PATH environmental variable.  So, no matter what directory you are in, the shell will find the command if:&lt;BR /&gt;1 - you specify the absolute patch (starting with /) to the command&lt;BR /&gt;2 - you specify a relative path (relative from your current directory) such as ./command or ../command or subdir/command&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;So to fix this, either:&lt;BR /&gt;1 - cd to the directory and run the command as ./command&lt;BR /&gt;2 - set your PATH manually after you login to include the current (.) directory using export PATH=$PATH:.&lt;BR /&gt;3 - set your PATH automatically whenever you login by putting export PATH=$PATH:. in your .profile&lt;BR /&gt;4 - you could add . to the PATH variable in /etc/profile but some people consider that a security violation.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Thu, 25 Oct 2001 19:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601602#M34386</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2001-10-25T19:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Full Path needed to execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601603#M34387</link>
      <description>Just a note about security.  While being able to cd to a directory and just type a command is convenient, it is a big security risk. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;So your system administrator decided that the current working directory should not be searched unless you take extra steps (the ./) to run the program.</description>
      <pubDate>Thu, 25 Oct 2001 23:26:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/full-path-needed-to-execute-a-command/m-p/2601603#M34387</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-10-25T23:26:30Z</dc:date>
    </item>
  </channel>
</rss>

