<?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: ksh: !:  not found in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262838#M715002</link>
    <description>As Steve says, "ksh" on HPUX is not quite the thing to use.  Use the posix shell "/usr/bin/sh".  This is not the bourne shell as it first seems.</description>
    <pubDate>Thu, 29 Apr 2004 09:15:45 GMT</pubDate>
    <dc:creator>Mark Grant</dc:creator>
    <dc:date>2004-04-29T09:15:45Z</dc:date>
    <item>
      <title>ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262835#M714999</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I'm having a problem with HP-UX ksh(1) : &lt;BR /&gt;&lt;BR /&gt;The man page for ksh clearly says:&lt;BR /&gt;&lt;BR /&gt;      A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence.&lt;BR /&gt;[...]&lt;BR /&gt;! expression                       True if expression is false.&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;Nonetheless, hpux's ksh doesn't seem to behave correctly on that point.&lt;BR /&gt;&lt;BR /&gt;I've tried 3 tests on ksh on Solaris 7 and 8 and Linux. On all teh system the behaviour was correct and as expected:&lt;BR /&gt;&lt;BR /&gt;TEST 1:&lt;BR /&gt;&lt;BR /&gt;   $ type !&lt;BR /&gt;&lt;BR /&gt;Expected result (right for all OS, except HPUX)&lt;BR /&gt;&lt;BR /&gt;   ! is a reserved shell keyword&lt;BR /&gt;&lt;BR /&gt;On HP-UX, we get:&lt;BR /&gt;&lt;BR /&gt;   ! not found&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TEST 2:&lt;BR /&gt;&lt;BR /&gt;   $ if ! true&lt;BR /&gt;     then&lt;BR /&gt;        echo TRUE&lt;BR /&gt;     else&lt;BR /&gt;        echo FALSE&lt;BR /&gt;     fi&lt;BR /&gt;&lt;BR /&gt;Expected result (right for all OS, except HPUX):&lt;BR /&gt;&lt;BR /&gt;   FALSE&lt;BR /&gt;&lt;BR /&gt;On HP-UX i get:&lt;BR /&gt;&lt;BR /&gt;ksh: !:  not found&lt;BR /&gt;FALSE&lt;BR /&gt;&lt;BR /&gt;(Although FALSE is written on the output, it's due to the fact that the if condition fails because ! is not known by this ksh)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TEST 3:&lt;BR /&gt;&lt;BR /&gt;   $ if ! false&lt;BR /&gt;     then&lt;BR /&gt;        echo TRUE&lt;BR /&gt;     else&lt;BR /&gt;        echo FALSE&lt;BR /&gt;     fi&lt;BR /&gt;&lt;BR /&gt;Expected result (right for all OS, except HPUX):&lt;BR /&gt;&lt;BR /&gt;   TRUE&lt;BR /&gt;&lt;BR /&gt;On HP-UX i get:&lt;BR /&gt;&lt;BR /&gt;ksh: !:  not found&lt;BR /&gt;FALSE&lt;BR /&gt;&lt;BR /&gt;(we get FALSE for te same reason as above).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On this HP-UX host, the ksh version is:&lt;BR /&gt;&lt;BR /&gt;adumont@psup01$ uname -a&lt;BR /&gt;HP-UX psup01 B.11.11 U 9000/800 624653342 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;adumont@psup01$ what $( which ksh )&lt;BR /&gt;/usr/bin/ksh:&lt;BR /&gt;         defs.c $Date: 2002/11/18 20:42:15 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         edit.c $Date: 2002/11/18 20:43:06 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         io.c $Date: 2002/11/18 20:47:57 $Revision: r11.11/3 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         cmd.c $Date: 2002/11/18 20:41:14 $Revision: r11.11/1 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         main.c $Date: 2002/11/18 20:52:03 $Revision: r11.11/4 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         xec.c $Date: 2002/11/18 20:52:56 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         macro.c $Date: 2002/11/18 20:51:03 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         error.c $Date: 2002/11/18 20:44:16 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         jobs.c $Date: 2002/11/18 20:49:04 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)&lt;BR /&gt;         $Revision: @(#) all CUP11.11_BL2002_1129_1 PATCH_11.11 PHCO_27019&lt;BR /&gt;         Fri Nov 29 08:52:39 PST 2002 $&lt;BR /&gt;         $ B.11.11_LR  Feb  8 2002 01:58:34 $&lt;BR /&gt;        Version 11/16/88&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Does someone have any explanation about that ? Or is it simply a ksh bug on HPUX ??&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2004 08:27:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262835#M714999</guid>
      <dc:creator>Alexandre Dumont_1</dc:creator>
      <dc:date>2004-04-29T08:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262836#M715000</link>
      <description>if u cover it with [ ] i.e. [ ! $false ]&lt;BR /&gt;&lt;BR /&gt;kaps</description>
      <pubDate>Thu, 29 Apr 2004 08:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262836#M715000</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-04-29T08:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262837#M715001</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Posix shell works&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;           Steve Steel</description>
      <pubDate>Thu, 29 Apr 2004 08:36:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262837#M715001</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2004-04-29T08:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262838#M715002</link>
      <description>As Steve says, "ksh" on HPUX is not quite the thing to use.  Use the posix shell "/usr/bin/sh".  This is not the bourne shell as it first seems.</description>
      <pubDate>Thu, 29 Apr 2004 09:15:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262838#M715002</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-29T09:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262839#M715003</link>
      <description>Thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;I know that sh-posix(1) is a better shell. IMHO, i really like it much more than ksh. &lt;BR /&gt;&lt;BR /&gt;The problem is that i'm trying to write a script that will have to run on any platform (a monitor for OVO).&lt;BR /&gt;&lt;BR /&gt;I'm badly surprised that "!" is not recognized by the hpux's ksh. I think it's a bug.&lt;BR /&gt;&lt;BR /&gt;The only problem i find to sh-posix(1) is that i have only been able to use it on hp-ux. (but not all the systems are hp-ux -- unfortunately ;) ). AFAIK, it's not available under Solaris neither Linux.&lt;BR /&gt;&lt;BR /&gt;I've also tried with [ ! expr ], but it doesn't work correctly neither.&lt;BR /&gt;&lt;BR /&gt;Any other suggestion?</description>
      <pubDate>Thu, 29 Apr 2004 17:01:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262839#M715003</guid>
      <dc:creator>Alexandre Dumont_1</dc:creator>
      <dc:date>2004-04-29T17:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: !:  not found</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262840#M715004</link>
      <description>I know it is a duplicate effort but how does having two versions of the script pushed out to all the clients with a OS type check at the beginning sound. Initial script can run only once and according to the OS type test result you can delete the unnecesary one, ksh version for hpux and posix version for all others. I know this is not ideal or a full solution in the literal meaning of the word, but at least it can buy yo some time until you come up with something more permanent. A workaround more than anything else.&lt;BR /&gt;&lt;BR /&gt;my 2 cents</description>
      <pubDate>Thu, 29 Apr 2004 17:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-not-found/m-p/3262840#M715004</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2004-04-29T17:31:51Z</dc:date>
    </item>
  </channel>
</rss>

