<?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 ksh bug? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797751#M641483</link>
    <description>I have a ksh script issue where it appears that /usr/bin/ksh ignores an alias, and searches for it elsewhere (namely FPATH).&lt;BR /&gt; &lt;BR /&gt;The script in question makes use of some aliases that are created by a dotted in script.  These are aliases used by dozens of Oracle-related scripts, and they work elsewhere, all the time (or we would be down hard!).&lt;BR /&gt; &lt;BR /&gt;I've put "alias | grep &lt;ALIAS name=""&gt;" before and after the alias reference, and it displays the alias accurately, but in execution it can't find it (and sets ${?} to 1).  Stderr shows that that the alias was not found.&lt;BR /&gt; &lt;BR /&gt;If I replace the alias call with the actual script name, it works just fine.  But - I don't want to do that because it defeats the purpose of the aliases - which is to enable us to alter Oracle environments using one script.&lt;BR /&gt; &lt;BR /&gt;The script also calls some functions that are accessed via "typeset -fu ...." and "typeset FPATH="...".  When I create a function with the same name as the alias, it finds it, and executes it as a function.&lt;BR /&gt; &lt;BR /&gt;PHCO-38559 is installed.&lt;BR /&gt; &lt;BR /&gt;Is this a bug?  What's the expected behavior?  I can't find a definitive reference as to the search order for aliases, functions, etc.&lt;/ALIAS&gt;</description>
    <pubDate>Fri, 10 Jun 2011 14:34:58 GMT</pubDate>
    <dc:creator>MoreSawdust</dc:creator>
    <dc:date>2011-06-10T14:34:58Z</dc:date>
    <item>
      <title>ksh bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797751#M641483</link>
      <description>I have a ksh script issue where it appears that /usr/bin/ksh ignores an alias, and searches for it elsewhere (namely FPATH).&lt;BR /&gt; &lt;BR /&gt;The script in question makes use of some aliases that are created by a dotted in script.  These are aliases used by dozens of Oracle-related scripts, and they work elsewhere, all the time (or we would be down hard!).&lt;BR /&gt; &lt;BR /&gt;I've put "alias | grep &lt;ALIAS name=""&gt;" before and after the alias reference, and it displays the alias accurately, but in execution it can't find it (and sets ${?} to 1).  Stderr shows that that the alias was not found.&lt;BR /&gt; &lt;BR /&gt;If I replace the alias call with the actual script name, it works just fine.  But - I don't want to do that because it defeats the purpose of the aliases - which is to enable us to alter Oracle environments using one script.&lt;BR /&gt; &lt;BR /&gt;The script also calls some functions that are accessed via "typeset -fu ...." and "typeset FPATH="...".  When I create a function with the same name as the alias, it finds it, and executes it as a function.&lt;BR /&gt; &lt;BR /&gt;PHCO-38559 is installed.&lt;BR /&gt; &lt;BR /&gt;Is this a bug?  What's the expected behavior?  I can't find a definitive reference as to the search order for aliases, functions, etc.&lt;/ALIAS&gt;</description>
      <pubDate>Fri, 10 Jun 2011 14:34:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797751#M641483</guid>
      <dc:creator>MoreSawdust</dc:creator>
      <dc:date>2011-06-10T14:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797752#M641484</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Did the script in question suddenly stop working on the server on which you have the problem or is this the first time running it there?&lt;BR /&gt;&lt;BR /&gt;A sample of code that demonstrates the problem would be very nice to see.&lt;BR /&gt;&lt;BR /&gt;That said, the search order should be:&lt;BR /&gt;&lt;BR /&gt;1. keywords&lt;BR /&gt;2. aliases&lt;BR /&gt;3. shell builtins&lt;BR /&gt;4. functions&lt;BR /&gt;5. external programs found via the PATH variable&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 10 Jun 2011 15:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797752#M641484</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-06-10T15:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797753#M641485</link>
      <description>&amp;gt;I've put "alias | grep &lt;ALIAS name=""&gt;" before and after the alias reference,&lt;BR /&gt;&lt;BR /&gt;Have you tried "whence -v &lt;ALIAS name=""&gt;"?&lt;BR /&gt;&lt;BR /&gt;If you quote the first char of an alias, it isn't one.&lt;/ALIAS&gt;&lt;/ALIAS&gt;</description>
      <pubDate>Sat, 11 Jun 2011 04:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797753#M641485</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-06-11T04:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: ksh bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797754#M641486</link>
      <description>how do you execute your script?&lt;BR /&gt;It just means that your  default definition file was not sourced ( . file )&lt;BR /&gt;&lt;BR /&gt;where are the alias defined? in what file?&lt;BR /&gt;.profile? .kshrc?&lt;BR /&gt;does the .profile defined the ENV variable?&lt;BR /&gt;Depending on how you exectute your script those files are not sourced, &lt;BR /&gt;- to check that you can at a echo in your .profile/.kshrc, to see if they are sourced.&lt;BR /&gt;then if you need them you can either:&lt;BR /&gt;explicitely source them in your script for instance.&lt;BR /&gt;. /somewhere/mydefaultdefinitions&lt;BR /&gt;&lt;BR /&gt;or test if a variable is defined before sourcing&lt;BR /&gt;if [ -z  "${MYVARIABLE}" ]&lt;BR /&gt;then&lt;BR /&gt;   .   /somewhere/mydefaultdefinitions&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 11 Jun 2011 08:23:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-bug/m-p/4797754#M641486</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2011-06-11T08:23:01Z</dc:date>
    </item>
  </channel>
</rss>

