<?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: typeset -A in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194672#M165385</link>
    <description>You can also create a one-dimensional array in Korn shell as follows:&lt;BR /&gt;&lt;BR /&gt;array[0]=tom&lt;BR /&gt;array[1]=jane&lt;BR /&gt;print ${array[0]}&lt;BR /&gt;tom&lt;BR /&gt;print ${array[1]}&lt;BR /&gt;jane&lt;BR /&gt; &lt;BR /&gt;Elena</description>
    <pubDate>Tue, 17 Feb 2004 17:07:44 GMT</pubDate>
    <dc:creator>Elena Leontieva</dc:creator>
    <dc:date>2004-02-17T17:07:44Z</dc:date>
    <item>
      <title>typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194668#M165381</link>
      <description>Several docs noted that&lt;BR /&gt;&lt;BR /&gt;typeset -A foo&lt;BR /&gt;foo = ([z]=a [y]=b)&lt;BR /&gt;&lt;BR /&gt;is for ksh to use to assign associative array. I tried on hpux and got&lt;BR /&gt;ksh: typeset: bad option(s)&lt;BR /&gt;on linux, it says&lt;BR /&gt;ksh: typeset -A: unknown option.&lt;BR /&gt;&lt;BR /&gt;What's wrong?&lt;BR /&gt;&lt;BR /&gt;Jun Z</description>
      <pubDate>Tue, 17 Feb 2004 16:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194668#M165381</guid>
      <dc:creator>Jun Zhang_4</dc:creator>
      <dc:date>2004-02-17T16:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194669#M165382</link>
      <description>I think that you are confusing typeset -A with set -A --- and the arrays are not associative but numeric ranging from 0 to a maximum of 1023.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For example,&lt;BR /&gt;set -A arry red orange yellow green blue indigo violet&lt;BR /&gt;&lt;BR /&gt;echo ${arry[0]}&lt;BR /&gt;$ red&lt;BR /&gt;echo ${arry[6]}&lt;BR /&gt;$ violet&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2004 16:49:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194669#M165382</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-02-17T16:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194670#M165383</link>
      <description>Hi Jun,&lt;BR /&gt;&lt;BR /&gt;In ksh &amp;amp; sh-posix you'd use&lt;BR /&gt;set -A array_name value1 value2 ....&lt;BR /&gt;to set a one-dimensional array.&lt;BR /&gt;That's all the shell can handle AFAIK.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 17 Feb 2004 16:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194670#M165383</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-02-17T16:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194671#M165384</link>
      <description>You might try 'set -A' which sets values to an array.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2004 16:53:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194671#M165384</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2004-02-17T16:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194672#M165385</link>
      <description>You can also create a one-dimensional array in Korn shell as follows:&lt;BR /&gt;&lt;BR /&gt;array[0]=tom&lt;BR /&gt;array[1]=jane&lt;BR /&gt;print ${array[0]}&lt;BR /&gt;tom&lt;BR /&gt;print ${array[1]}&lt;BR /&gt;jane&lt;BR /&gt; &lt;BR /&gt;Elena</description>
      <pubDate>Tue, 17 Feb 2004 17:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194672#M165385</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2004-02-17T17:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194673#M165386</link>
      <description>the -A attribute to define an associative array is available only on version of ksh newer the the 11/16/88 version. Unfortunately, HP's /usr/bin/ksh isn't.&lt;BR /&gt;&lt;BR /&gt;if it did you'd do something like this:&lt;BR /&gt;typeset -A color&lt;BR /&gt;color[apple]=red&lt;BR /&gt;color[banana]=yellow&lt;BR /&gt;...etc.</description>
      <pubDate>Tue, 17 Feb 2004 21:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194673#M165386</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-02-17T21:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194674#M165387</link>
      <description>The associative array is what I'm trying to use.&lt;BR /&gt;What happens to you when you type in ksh&lt;BR /&gt;&lt;BR /&gt;typeset -A foo&lt;BR /&gt;&lt;BR /&gt;?&lt;BR /&gt;Jun</description>
      <pubDate>Wed, 18 Feb 2004 09:18:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194674#M165387</guid>
      <dc:creator>Jun Zhang_4</dc:creator>
      <dc:date>2004-02-18T09:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194675#M165388</link>
      <description>Hi Jun Z&lt;BR /&gt;&lt;BR /&gt;Simply&lt;BR /&gt;&lt;BR /&gt;/usr/bin/ksh typeset: bad option(s)&lt;BR /&gt;&lt;BR /&gt;set is your huckleberry....&lt;BR /&gt;&lt;BR /&gt;jeff</description>
      <pubDate>Wed, 18 Feb 2004 10:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194675#M165388</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-02-18T10:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194676#M165389</link>
      <description>Excuse me, Did we give you BAD advice........?&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Feb 2004 10:14:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194676#M165389</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-02-18T10:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: typeset -A</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194677#M165390</link>
      <description>in hp's /usr/bin/ksh if you want to assign values to an array the syntax would be:&lt;BR /&gt;set [+-]A arrayName args&lt;BR /&gt;&lt;BR /&gt;the values are assigned sequentially from zero and has a maximum of 1024 elements, 1023 is the largest index.&lt;BR /&gt;&lt;BR /&gt;use -A to unset the array prior to the assignment.&lt;BR /&gt;&lt;BR /&gt;#assigns f[0]=1 and f[1]=4&lt;BR /&gt;set -A f 1 4&lt;BR /&gt;#assigns f[0]=5, but f[1] is left alone&lt;BR /&gt;set +A f 5&lt;BR /&gt;&lt;BR /&gt;if you really need to use associative arrays you'll have to use a tool that supports them,&lt;BR /&gt;/usr/dt/bin/dtksh, awk, perl, etc.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Feb 2004 10:47:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/typeset-a/m-p/3194677#M165390</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-02-18T10:47:41Z</dc:date>
    </item>
  </channel>
</rss>

