<?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: array help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470125#M704170</link>
    <description>The sh-posix's array is a bit limited.&lt;BR /&gt;For nested data structure I'd rather suggest Perl, especially with its magic autivivification.&lt;BR /&gt; &lt;BR /&gt;Without delving into your code you can quite easily determine how many elements your host aray got assigned.&lt;BR /&gt;Simply evaluate ${#host[*]}&lt;BR /&gt;But I bet you knew that.</description>
    <pubDate>Tue, 25 Jan 2005 10:02:24 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2005-01-25T10:02:24Z</dc:date>
    <item>
      <title>array help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470123#M704168</link>
      <description>Hi Everyone&lt;BR /&gt;&lt;BR /&gt;Need a little help with comparing information in arrays. &lt;BR /&gt;&lt;BR /&gt;I have the below example from a script&lt;BR /&gt;&lt;BR /&gt;check=0&lt;BR /&gt;hostnum=0&lt;BR /&gt;offset=10&lt;BR /&gt;       &lt;BR /&gt;for hosts in ${host[@]}&lt;BR /&gt;                do                       swlist @ $hosts | egrep  'MC ?\/ ?Service ?Guard' | while read num ver desc&lt;BR /&gt;                  do&lt;BR /&gt;                                       ((index=hostnum*offset+check ))&lt;BR /&gt;                                               colnum[$index]=$num&lt;BR /&gt;                                               colver[$index]=$ver&lt;BR /&gt;                                               coldesc[$index]=$desc&lt;BR /&gt;                                              ((check = check + 1 ))&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a seperate array for each column, then compare per column to ensure they are equal. The output looks like below. How can I now compare each column when I don't know how many hosts I have or number of columns ?&lt;BR /&gt;&lt;BR /&gt;below is the make up of each array element&lt;BR /&gt;&lt;BR /&gt;colnum[0]=B3935DA&lt;BR /&gt;colver[0]=A.11.14&lt;BR /&gt;coldesc[0]=MC / Service Guard&lt;BR /&gt;colnum[1]=PHSS_29915&lt;BR /&gt;colver[1]=1.0&lt;BR /&gt;coldesc[1]=MC/ServiceGuard and SG-OPS Edition A.11.14&lt;BR /&gt;colnum[12]=B3935DA&lt;BR /&gt;colver[12]=A.11.14&lt;BR /&gt;coldesc[12]=MC / Service Guard&lt;BR /&gt;colnum[13]=PHSS_29915&lt;BR /&gt;colver[13]=1.0&lt;BR /&gt;coldesc[13]=MC/ServiceGuard and SG-OPS Edition A.11.14&lt;BR /&gt;&lt;BR /&gt;Hmmm, typing this out I can see that it's getting a bit messy. I only want to compare for eg the output of each line against it's adjacent line&lt;BR /&gt;&lt;BR /&gt;so&lt;BR /&gt;&lt;BR /&gt;line 1 column 1 against (if there is one) line 1 column 1 of the output for the next host etc etc&lt;BR /&gt;&lt;BR /&gt;uuurrrggghhh&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Steven&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jan 2005 01:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470123#M704168</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2005-01-25T01:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: array help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470124#M704169</link>
      <description>I finish now for the day so will pick up any responses when I get up this afternoon&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;Steven</description>
      <pubDate>Tue, 25 Jan 2005 01:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470124#M704169</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2005-01-25T01:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: array help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470125#M704170</link>
      <description>The sh-posix's array is a bit limited.&lt;BR /&gt;For nested data structure I'd rather suggest Perl, especially with its magic autivivification.&lt;BR /&gt; &lt;BR /&gt;Without delving into your code you can quite easily determine how many elements your host aray got assigned.&lt;BR /&gt;Simply evaluate ${#host[*]}&lt;BR /&gt;But I bet you knew that.</description>
      <pubDate>Tue, 25 Jan 2005 10:02:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/array-help/m-p/3470125#M704170</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-01-25T10:02:24Z</dc:date>
    </item>
  </channel>
</rss>

