<?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: 2 dimensional Array in Shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842719#M91530</link>
    <description>If Perl is not a viable solution for you give us more detail of what exactly your trying to accomplish and we may be able to help you.&lt;BR /&gt;</description>
    <pubDate>Tue, 12 Nov 2002 06:37:19 GMT</pubDate>
    <dc:creator>Steve Faidley</dc:creator>
    <dc:date>2002-11-12T06:37:19Z</dc:date>
    <item>
      <title>2 dimensional Array in Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842716#M91527</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I have a question about using the 2 dimensional array in Shell script?  Can anyone tell me how to implement the 2 dimensional array through Ksh or sh ?&lt;BR /&gt;&lt;BR /&gt;Much appreciated if you can provide additional link for reference.&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;&lt;BR /&gt;Chris,</description>
      <pubDate>Tue, 12 Nov 2002 01:57:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842716#M91527</guid>
      <dc:creator>Chris Fung</dc:creator>
      <dc:date>2002-11-12T01:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dimensional Array in Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842717#M91528</link>
      <description>Hi Chris,&lt;BR /&gt;&lt;BR /&gt;I don't think you can do it in either ksh or in the Posix shell.  Here is a URL to the HP-UX 11.00 commands docs for 'sh-posix' and 'ksh'.  The snippet of text is found in the descriptions for both 'ksh' and 'sh-posix':&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/B2355-90680/B2355-90680.html" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/B2355-90680/B2355-90680.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;"The shell supports a limited one-dimensional array facility. An element of an array parameter is referenced by a subscript. A subscript is denoted by a [, followed by an arithmetic expression, followed by a ]. See the "Arithmetic Evaluation" subsection. To assign values to an array, use set -A name value .... The value of all subscripts must be in the range of 0 through 1023. Arrays need not be declared. Any reference to a named parameter with a valid subscript is legal and an array is created if necessary. Referencing an array parameter without a subscript is equivalent to referencing the first element."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now, someone might know of some trick to access a two dimensional array in a shell script, but I don't know of any way to do it.  I think the question has been posed here on the forum before, but I couldn't find it anywhere.&lt;BR /&gt;&lt;BR /&gt;I think you can do two dimensional arrays in 'awk', but I haven't tried it.  You can do it in Perl, which is what I would suggest, especially since it is so easy to get Perl for HP-UX and install it.&lt;BR /&gt;&lt;BR /&gt;I'm just curious, but what problem are you trying to solve with the two dimensional arrays?&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Nov 2002 02:38:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842717#M91528</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-11-12T02:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dimensional Array in Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842718#M91529</link>
      <description>&lt;BR /&gt;perl&lt;BR /&gt;&lt;BR /&gt;perl will run many times faster than anything you can implement in sh/ksh. And yes, it has arrays!&lt;BR /&gt;&lt;BR /&gt;If you must continue with "two" dimensional array's in sh/ksh, then you will have to use two different variable names and just fake it!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 12 Nov 2002 03:10:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842718#M91529</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-11-12T03:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dimensional Array in Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842719#M91530</link>
      <description>If Perl is not a viable solution for you give us more detail of what exactly your trying to accomplish and we may be able to help you.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Nov 2002 06:37:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842719#M91530</guid>
      <dc:creator>Steve Faidley</dc:creator>
      <dc:date>2002-11-12T06:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dimensional Array in Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842720#M91531</link>
      <description>If Perl is not a viable solution for you give us more detail of what exactly your trying to accomplish and we may be able to help you.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Nov 2002 06:37:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/2-dimensional-array-in-shell-script/m-p/2842720#M91531</guid>
      <dc:creator>Steve Faidley</dc:creator>
      <dc:date>2002-11-12T06:37:58Z</dc:date>
    </item>
  </channel>
</rss>

