<?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: shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948155#M931644</link>
    <description />
    <pubDate>Thu, 10 Apr 2003 11:17:18 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2003-04-10T11:17:18Z</dc:date>
    <item>
      <title>shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948154#M931643</link>
      <description>hi all&lt;BR /&gt;is there aby way to use array in shell script to save variables&lt;BR /&gt;thanks</description>
      <pubDate>Thu, 10 Apr 2003 11:08:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948154#M931643</guid>
      <dc:creator>tarek_3</dc:creator>
      <dc:date>2003-04-10T11:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948155#M931644</link>
      <description />
      <pubDate>Thu, 10 Apr 2003 11:17:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948155#M931644</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-04-10T11:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948156#M931645</link>
      <description>yes, but only one dimensional arrays.&lt;BR /&gt;&lt;BR /&gt;e.g. in korn/posix&lt;BR /&gt;&lt;BR /&gt;i[0]="foo"&lt;BR /&gt;i[1]="bar"&lt;BR /&gt;i[2]="baz"&lt;BR /&gt;&lt;BR /&gt;for x in 0 1 2&lt;BR /&gt;do&lt;BR /&gt;echo ${i[${x}]}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Thu, 10 Apr 2003 11:18:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948156#M931645</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2003-04-10T11:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948157#M931646</link>
      <description>Hi Tarek,&lt;BR /&gt;&lt;BR /&gt;Yes you can...&lt;BR /&gt;&lt;BR /&gt;Like in any other programming languages Arrays in Korn SHELL are variables that contain more than one value.&lt;BR /&gt;&lt;BR /&gt;example...&lt;BR /&gt;&lt;BR /&gt;integer my_array&lt;BR /&gt;my_array[0]=5&lt;BR /&gt;my_array[1]=16&lt;BR /&gt;&lt;BR /&gt;The first element of an array is indexed by 0, the second element is 1, and so on. The largest index value that is valid for array is 1023.&lt;BR /&gt;&lt;BR /&gt;You must enclose an array reference in braces for the korn shell to recognize it as such.&lt;BR /&gt;&lt;BR /&gt;For example...&lt;BR /&gt;${my_array[1]}&lt;BR /&gt;&lt;BR /&gt;Instead of...&lt;BR /&gt;$my_array[1]&lt;BR /&gt;&lt;BR /&gt;The syntax for accessing the value of the nth array element is, where n is an integer... {my_array[n]}&lt;BR /&gt;&lt;BR /&gt;To print the values of all array elements, use the syntax:  {my_array[*]}&lt;BR /&gt;&lt;BR /&gt;To print the actual number of elements (assigned values) in the array use the syntax: {#array_name[*]}&lt;BR /&gt;&lt;BR /&gt;Array elements do not have to be assigned in order. Moreover, you can skip the assignment of values to any elements you want. For instance....&lt;BR /&gt;&lt;BR /&gt;my_array[2]=2&lt;BR /&gt;my_array[5]=3&lt;BR /&gt;my_array[1023]=1&lt;BR /&gt;&lt;BR /&gt;Array elements that are skipped over are not assigned a value and, effectively, are treated as though they do not exist.&lt;BR /&gt;&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;best regards...&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Apr 2003 08:24:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948157#M931646</guid>
      <dc:creator>Ricky B. Nino</dc:creator>
      <dc:date>2003-04-11T08:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948158#M931647</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;In k-shell use set with -A option to declare an array and read output of a command into the array in one step.&lt;BR /&gt;&lt;BR /&gt;$ set -A users `awk -F: '{print $1}' /etc/passwd`&lt;BR /&gt;&lt;BR /&gt;$ echo ${users[0]}&lt;BR /&gt;root&lt;BR /&gt;&lt;BR /&gt;hope this helps.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Fri, 11 Apr 2003 08:48:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948158#M931647</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-11T08:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948159#M931648</link>
      <description>Hi Tarek,&lt;BR /&gt;&lt;BR /&gt;  Use this URL documentation for compelete reference also:&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/pdf/B2355-90046.pdf" target="_blank"&gt;http://docs.hp.com/hpux/pdf/B2355-90046.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Zafar</description>
      <pubDate>Fri, 11 Apr 2003 20:27:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2948159#M931648</guid>
      <dc:creator>Zafar A. Mohammed_1</dc:creator>
      <dc:date>2003-04-11T20:27:33Z</dc:date>
    </item>
  </channel>
</rss>

