<?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 Command not found error! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766702#M785545</link>
    <description>&lt;BR /&gt; Hi Guys,&lt;BR /&gt;&lt;BR /&gt; I have an error message in hp server while running a korn shell script which has been working fine for many many years and hasn't been changed.&lt;BR /&gt;&lt;BR /&gt; this script has acl permission bit set and someone has removed the acl permissions from it which makes sense why script not working anymore, however when I changed the permission and gave chmod 777 to this script it complains about a program file not found whick gets kicked off within that korn shell script, this program file does exist in the directory and always been there, below is the error message...&lt;BR /&gt;&lt;BR /&gt; Error "/usr/local/bin/spool_menu.ksh[125]: realroot: not found"&lt;BR /&gt;&lt;BR /&gt; I have checked the system PATH and /usr/local/bin is there, any ideas about the above error????</description>
    <pubDate>Wed, 05 Apr 2006 18:26:19 GMT</pubDate>
    <dc:creator>Becke</dc:creator>
    <dc:date>2006-04-05T18:26:19Z</dc:date>
    <item>
      <title>Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766702#M785545</link>
      <description>&lt;BR /&gt; Hi Guys,&lt;BR /&gt;&lt;BR /&gt; I have an error message in hp server while running a korn shell script which has been working fine for many many years and hasn't been changed.&lt;BR /&gt;&lt;BR /&gt; this script has acl permission bit set and someone has removed the acl permissions from it which makes sense why script not working anymore, however when I changed the permission and gave chmod 777 to this script it complains about a program file not found whick gets kicked off within that korn shell script, this program file does exist in the directory and always been there, below is the error message...&lt;BR /&gt;&lt;BR /&gt; Error "/usr/local/bin/spool_menu.ksh[125]: realroot: not found"&lt;BR /&gt;&lt;BR /&gt; I have checked the system PATH and /usr/local/bin is there, any ideas about the above error????</description>
      <pubDate>Wed, 05 Apr 2006 18:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766702#M785545</guid>
      <dc:creator>Becke</dc:creator>
      <dc:date>2006-04-05T18:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766703#M785546</link>
      <description>What is on line 125 of /usr/local/bin/spool_menu.ksh?&lt;BR /&gt;&lt;BR /&gt;It is saying it can't find "realroot"&lt;BR /&gt;&lt;BR /&gt;Try &lt;BR /&gt;which realroot&lt;BR /&gt;&lt;BR /&gt;You might have to set the full path in the script instead...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 05 Apr 2006 18:41:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766703#M785546</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-04-05T18:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766704#M785547</link>
      <description>Shalom Raf,&lt;BR /&gt;&lt;BR /&gt;Perhaps the file is hidden from the user.&lt;BR /&gt;&lt;BR /&gt;Check the permissoins on the program:&lt;BR /&gt;&lt;BR /&gt;The error is on line 125. It may be misreportting another program that it calls.&lt;BR /&gt;&lt;BR /&gt;Throw a set -x right after the shell statement in the script and you may get a better idea of what the problem is.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Apr 2006 18:41:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766704#M785547</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-04-05T18:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766705#M785548</link>
      <description>Hi Raf:&lt;BR /&gt;&lt;BR /&gt;Make sure that the *directory* --'/usr/local/bin' -- is readable and executable by the user running the script that gives the error.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 05 Apr 2006 18:45:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766705#M785548</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-04-05T18:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766706#M785549</link>
      <description>&lt;BR /&gt; Hi Steven/Geoff,&lt;BR /&gt;&lt;BR /&gt; Thanks for the quick responses guys, as this is a production problem, I had to get things going, so i have set the full path name of the command in the script which has got it working before I post this message, but this is not really resolving the problem and I want to find out the root cause as there are many other scripts in production which calls realroot and realroot program doesn't have the full path name in those scripts and obviously I don't want to manually set the full path name everywhere for realroot.&lt;BR /&gt;&lt;BR /&gt; When I typed in which realroot, it gives me the full path name ie (/usr/local/bin/realroot)&lt;BR /&gt;&lt;BR /&gt; I have reset the permissions on realroot (chmod 777 realroot)but when I run the script without the full path name it gives the same error ie (Error "/usr/local/bin/spool_menu.ksh[125]: realroot: not found")&lt;BR /&gt;&lt;BR /&gt;Here is the error message when i put in set -x right below the shell statement in the script.&lt;BR /&gt; &lt;BR /&gt;Enter a space separated list of ids to cancel, or (P) to select a printer&lt;BR /&gt;:- + read IDS&lt;BR /&gt;+ print Clear queue for printer - Please enter printer name : \c&lt;BR /&gt;Clear queue for printer - Please enter printer name : + read PRINTER&lt;BR /&gt;esd&lt;BR /&gt;+ [[ p = @(q|Q ]]&lt;BR /&gt;+ [[ esd = @(q|Q ]]&lt;BR /&gt;+ [[ -n esd ]]&lt;BR /&gt;+ realroot cancel esd -e&lt;BR /&gt;/usr/local/bin/spool_menu.ksh[126]: realroot:not found&lt;BR /&gt;+ print \n\nHit &lt;ENTER&gt; to continue :- \c&lt;BR /&gt;Hit &lt;ENTER&gt; to continue :- + read REPLY..&lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;Guys this script actually deletes jobs sitting on the printer queue...&lt;BR /&gt;&lt;BR /&gt; Cheers&lt;BR /&gt; Raf&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/ENTER&gt;&lt;/ENTER&gt;</description>
      <pubDate>Wed, 05 Apr 2006 19:10:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766706#M785549</guid>
      <dc:creator>Becke</dc:creator>
      <dc:date>2006-04-05T19:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766707#M785550</link>
      <description>How about add &lt;BR /&gt;&lt;BR /&gt;export PATH=$PATH:/usr/local/bin&lt;BR /&gt;&lt;BR /&gt;to top of script?&lt;BR /&gt;&lt;BR /&gt;BTW - I wouldn't have 777 on any script - 775 should be sufficient...&lt;BR /&gt;&lt;BR /&gt;It also may be that the script needs to be setuid&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 05 Apr 2006 19:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766707#M785550</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-04-05T19:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766708#M785551</link>
      <description>Changing a problem script to 777 never solves anything and has now made your script vulnerable to being trashed by anyone on your computer. Change it back to at least 755 to protect the contents. Note that changing the permission of a script won't change it's ability to search a directory (which is how the "not found" error is generated. It also does not matter what permissions realroot has -- even if it was 777 or 000 permission, the only way an error "not found" will occur is that the directory cannot be searched by the script, or that realroot is actually a symlink that points to a non-existant file.&lt;BR /&gt; &lt;BR /&gt;Just a note about PATH and scripts: Never use the PATH that the parent program (shell) uses. You have no control over it since any user (including root) can modify it, either on purpose or by accident. Instead, the first few lines in your script should have:&lt;BR /&gt; &lt;BR /&gt;export PATH=/usr/bin:/usr/local/bin&lt;BR /&gt; &lt;BR /&gt;This takes eefect only for the current script and disappears when the script terminates. If you need anotgher path, add it to your script.&lt;BR /&gt; &lt;BR /&gt;Another note about which and whereis. Neither command is useful in scripting or debugging. You want to know exactly what the shell will do when a a text string is seen. The commands which and whereis will fail to locate "for" and "done", yet they are perfectly valid items in a script. You want to use whence, or better yet, whence -v. To make things easier, whence -v is aliased to type in ksh and POSIX-sh. So to see what the shell will find when you refer to realroot, use this command:&lt;BR /&gt; &lt;BR /&gt;type realroot&lt;BR /&gt; &lt;BR /&gt;You may be (unpleasantly) surprised to see that it has been aliased, something that which and whereis will never tell you. &lt;BR /&gt; &lt;BR /&gt;And while you're at it, add set -u next to the PATH statement in your script. It prevents disastrous consequences due to spelling errors.</description>
      <pubDate>Wed, 05 Apr 2006 19:22:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766708#M785551</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-04-05T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766709#M785552</link>
      <description>And to explain why /usr/local/bin/realroot works but realroot does not again points to the permissions of /usr /usr/local and /usr/local/bin. Note that HP-UX has had bad permissions on the /usr/local directories for years (ie, 777) when they should be identical to /usr/contrib. Someone may have inadvertantly changed 777 to 700 or 744. The reason that a full pathname works is that no search is needed -- the entire path has been given. Without a full path, the /usr/local/bin directory must be searched to find realroot.</description>
      <pubDate>Wed, 05 Apr 2006 19:28:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766709#M785552</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-04-05T19:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766710#M785553</link>
      <description>&lt;BR /&gt; Hi Team,&lt;BR /&gt;&lt;BR /&gt; Thanks to everyone's prompt response and help, I have checked the permissions on /usr/local and /usr/local/bin directories and the user has access to it.&lt;BR /&gt;&lt;BR /&gt; Bill and Geoff your suggestion worked as I have added the "export PATH=/usr/bin:/usr/local/bin" statement in script and its working like a charm, I have also added the path statement in user's .profile so it searches for the right directory as user's .profile kicks off the shell script and from the main menu user takes an option which kicks off this script which had problems.&lt;BR /&gt;&lt;BR /&gt;I have changed the permissions to 777 temporarily just to test the script. I have now changed it back to 755..&lt;BR /&gt;&lt;BR /&gt; Bill thanks for your detailed explanation, I have learned again something new today from our team. I will now assign points&lt;BR /&gt;&lt;BR /&gt; Cheers,&lt;BR /&gt; Raf&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Apr 2006 20:35:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766710#M785553</guid>
      <dc:creator>Becke</dc:creator>
      <dc:date>2006-04-05T20:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766711#M785554</link>
      <description>Hi Raf, &lt;BR /&gt;&lt;BR /&gt;Whenever you write any scripts, make sure you use absolute path or export PATH on top of the script to your special or custom commands. It is always a good practice. Just a thought i should share. &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Wed, 05 Apr 2006 21:28:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766711#M785554</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-04-05T21:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766712#M785555</link>
      <description>Exporting a binary directory path into PATH will not solve the problem always.&lt;BR /&gt;&lt;BR /&gt;upper level directory permission for execution is needed to be check&lt;BR /&gt;&lt;BR /&gt;If there are binaries with same name but in different location then PATH variable decides which one has to be executed. We have to be sure on that else,&lt;BR /&gt;&lt;BR /&gt;OLDPATH=$PATH&lt;BR /&gt;PATH=...:..:..&lt;BR /&gt;&lt;BR /&gt;..&lt;CODE&gt;..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;export PATH=$OLDPATH&lt;BR /&gt;&lt;BR /&gt;use this in your script.&lt;BR /&gt;&lt;BR /&gt;PS: You've got the solution. Assing 0 points to this ;)&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;</description>
      <pubDate>Thu, 06 Apr 2006 01:47:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766712#M785555</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-04-06T01:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Command not found error!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766713#M785556</link>
      <description>&lt;BR /&gt; Thanks as always Arun/Muthu for your input.....&lt;BR /&gt;&lt;BR /&gt; As the problem has now been resolved but I'd love to give you a bottle of coke and a choclate along with the points:)....</description>
      <pubDate>Thu, 06 Apr 2006 02:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-not-found-error/m-p/3766713#M785556</guid>
      <dc:creator>Becke</dc:creator>
      <dc:date>2006-04-06T02:19:08Z</dc:date>
    </item>
  </channel>
</rss>

