<?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: Korn shell question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140555#M724752</link>
    <description>no "typeset -A" in hpux ksh. use "set -A name variable" instead.&lt;BR /&gt;&lt;BR /&gt;Moreover,I'm convinced that ksh array is a standard 1-level array with index. I.e you should use : wavelength[1]="red",[2]="orange" and so on. What you may need here is a named reference. It is nicely implemented with perl's hashes. ksh93 gives associative arrays,as well,there you can use strings as an index.</description>
    <pubDate>Tue, 05 Feb 2008 15:59:41 GMT</pubDate>
    <dc:creator>Zeev Schultz</dc:creator>
    <dc:date>2008-02-05T15:59:41Z</dc:date>
    <item>
      <title>Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140549#M724746</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I wanted to write a ksh script that uses arrays.&lt;BR /&gt;Since I was not familiar with the syntax, I looked up some code on the net.&lt;BR /&gt;This is what I found:&lt;BR /&gt;"&lt;BR /&gt;typeset -A wavelength&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;wavelength["red"]=650&lt;BR /&gt;wavelength["orange"]=590&lt;BR /&gt;wavelength["green"]=510&lt;BR /&gt;wavelength["blue"]=475&lt;BR /&gt;wavelength["indigo"]=445&lt;BR /&gt;wavelength["violet"]=400&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;This is what I want to do but when test this code then 'typeset -A' is not recognised.&lt;BR /&gt;If replace 'typeset -A' by 'set -A' then I get 'red: bad number'&lt;BR /&gt;&lt;BR /&gt;It seems that version of Korn shell on my system is to old (not Korn 93). I am running 11.11. &lt;BR /&gt;&lt;BR /&gt;Is this correct or is the syntax just wrong?&lt;BR /&gt;&lt;BR /&gt;Any help much appreciated.&lt;BR /&gt;&lt;BR /&gt;KRis</description>
      <pubDate>Tue, 05 Feb 2008 13:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140549#M724746</guid>
      <dc:creator>Quark</dc:creator>
      <dc:date>2008-02-05T13:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140550#M724747</link>
      <description>Hi Kris:&lt;BR /&gt;&lt;BR /&gt;The standard HP-UX version of the Korn shell found in '/usr/bin/ksh' is Korn88.  You can find the Korn93 version as:&lt;BR /&gt;&lt;BR /&gt;/usr/dt/bin/dtksh&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Feb 2008 13:22:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140550#M724747</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-02-05T13:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140551#M724748</link>
      <description>KRis,&lt;BR /&gt;&lt;BR /&gt;It may well be that an Ksh script with arrays is the optimal (learning, processing, price, security, tools) way to solve the challenge on hand.&lt;BR /&gt;&lt;BR /&gt;However, in my experience most such task are better done in AWK or PERL.&lt;BR /&gt;&lt;BR /&gt;What problem are you really trying to solve?&lt;BR /&gt;Outline it here (with concrete input and output) and we may be able to help you better.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Feb 2008 13:25:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140551#M724748</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-02-05T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140552#M724749</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;with set -A you can only use integer as index of the array. check man ksh&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 05 Feb 2008 13:27:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140552#M724749</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2008-02-05T13:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140553#M724750</link>
      <description>And what happened to "yellow"?</description>
      <pubDate>Tue, 05 Feb 2008 15:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140553#M724750</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-02-05T15:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140554#M724751</link>
      <description>From your sample snippet,&lt;BR /&gt;what you want is a hash&lt;BR /&gt;(or a so called associative array).&lt;BR /&gt;I am not into Korn shell in particular&lt;BR /&gt;because I never require it.&lt;BR /&gt;As for most array capable shells,&lt;BR /&gt;they expect indeces to be unsigned integers&lt;BR /&gt;(often only ranging from 0-1023).&lt;BR /&gt;But you can script in awk, Perl, Python or Ruby for key value paired lists.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Feb 2008 15:26:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140554#M724751</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-02-05T15:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140555#M724752</link>
      <description>no "typeset -A" in hpux ksh. use "set -A name variable" instead.&lt;BR /&gt;&lt;BR /&gt;Moreover,I'm convinced that ksh array is a standard 1-level array with index. I.e you should use : wavelength[1]="red",[2]="orange" and so on. What you may need here is a named reference. It is nicely implemented with perl's hashes. ksh93 gives associative arrays,as well,there you can use strings as an index.</description>
      <pubDate>Tue, 05 Feb 2008 15:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140555#M724752</guid>
      <dc:creator>Zeev Schultz</dc:creator>
      <dc:date>2008-02-05T15:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Korn shell question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140556#M724753</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;While I agree that associative arrays are better handled in 'awk' or Perl (where they are called "hashes"), you _CAN_ do this with the Korn93 shell _ON_ HP-UX with as I noted above.  You must use :&lt;BR /&gt;&lt;BR /&gt;/usr/bin/dt/dtksh&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 05 Feb 2008 16:16:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-question/m-p/4140556#M724753</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-02-05T16:16:02Z</dc:date>
    </item>
  </channel>
</rss>

