<?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 Shell Problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569063#M830893</link>
    <description>My problem is, how do I echo ${filesystem$i[$h]}? What needs to go where the $i is?&lt;BR /&gt;&lt;BR /&gt; filesystem1[1]="north"&lt;BR /&gt;&lt;BR /&gt; filesystem1[2]="south"&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[1]}&lt;BR /&gt;&lt;BR /&gt; north&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[2]}&lt;BR /&gt;&lt;BR /&gt; south&lt;BR /&gt;&lt;BR /&gt; h=1&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[$h]}&lt;BR /&gt;&lt;BR /&gt; north&lt;BR /&gt;&lt;BR /&gt; ((h=$h+1))&lt;BR /&gt;&lt;BR /&gt; ${filesystem1[$h]}&lt;BR /&gt;&lt;BR /&gt; south&lt;BR /&gt;&lt;BR /&gt; i=1&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem$i[$h]}&lt;BR /&gt;&lt;BR /&gt; sh: ${filesystem$i[$h]}: The specified  substitution is not valid for this command.&lt;BR /&gt;&lt;BR /&gt; ${filesystem"$i"[$h]}&lt;BR /&gt;&lt;BR /&gt;sh: ${filesystem"$i"[$h]}: The specified substitution is not valid for this command.&lt;BR /&gt;</description>
    <pubDate>Thu, 23 Jun 2005 02:18:51 GMT</pubDate>
    <dc:creator>Brian Dore</dc:creator>
    <dc:date>2005-06-23T02:18:51Z</dc:date>
    <item>
      <title>Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569063#M830893</link>
      <description>My problem is, how do I echo ${filesystem$i[$h]}? What needs to go where the $i is?&lt;BR /&gt;&lt;BR /&gt; filesystem1[1]="north"&lt;BR /&gt;&lt;BR /&gt; filesystem1[2]="south"&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[1]}&lt;BR /&gt;&lt;BR /&gt; north&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[2]}&lt;BR /&gt;&lt;BR /&gt; south&lt;BR /&gt;&lt;BR /&gt; h=1&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem1[$h]}&lt;BR /&gt;&lt;BR /&gt; north&lt;BR /&gt;&lt;BR /&gt; ((h=$h+1))&lt;BR /&gt;&lt;BR /&gt; ${filesystem1[$h]}&lt;BR /&gt;&lt;BR /&gt; south&lt;BR /&gt;&lt;BR /&gt; i=1&lt;BR /&gt;&lt;BR /&gt; echo ${filesystem$i[$h]}&lt;BR /&gt;&lt;BR /&gt; sh: ${filesystem$i[$h]}: The specified  substitution is not valid for this command.&lt;BR /&gt;&lt;BR /&gt; ${filesystem"$i"[$h]}&lt;BR /&gt;&lt;BR /&gt;sh: ${filesystem"$i"[$h]}: The specified substitution is not valid for this command.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 02:18:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569063#M830893</guid>
      <dc:creator>Brian Dore</dc:creator>
      <dc:date>2005-06-23T02:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569064#M830894</link>
      <description>I think u r trying to create a two dimensional array . See the attachment to see a workaround to emulate a two dimensional array ( it is for linux , u need to write the script with the same logic )</description>
      <pubDate>Thu, 23 Jun 2005 07:28:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569064#M830894</guid>
      <dc:creator>Bejoy C Alias</dc:creator>
      <dc:date>2005-06-23T07:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569065#M830895</link>
      <description>99 times out of a hundred, when you think you need to do this, in fact you don't. Maybe if you were to explain in more details, the specifics of what you were after, it might be possible to come up with an alternative.</description>
      <pubDate>Thu, 23 Jun 2005 08:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569065#M830895</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2005-06-23T08:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569066#M830896</link>
      <description>You have a spelling error. The array is filesystem1 but your failing example shows:&lt;BR /&gt; &lt;BR /&gt;filesystem$i&lt;BR /&gt; &lt;BR /&gt;You can avoid this type of problem (by getting a useful error message) using the set -u option at the start of your script. Any time an undefined variable is referenced (ie, echo) the script will stop and identify the location.</description>
      <pubDate>Thu, 23 Jun 2005 08:06:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569066#M830896</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-23T08:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569067#M830897</link>
      <description>&lt;BR /&gt;He is trying to do this:&lt;BR /&gt;&lt;BR /&gt;filesystem1[1]="north"&lt;BR /&gt;filesystem1[2]="south" &lt;BR /&gt;filesystem2[1]="east" &lt;BR /&gt;filesystem2[2]="west" &lt;BR /&gt;&lt;BR /&gt;then referencing the SUBSCRIPTS of the variables&lt;BR /&gt;"filesystem1"&lt;BR /&gt;and&lt;BR /&gt;"filesystem2"&lt;BR /&gt;&lt;BR /&gt;He wants this to happen:&lt;BR /&gt;$i=1&lt;BR /&gt;$h=2&lt;BR /&gt;echo $filesystem$i[$h]&lt;BR /&gt;producing "south" as output&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;$i=2&lt;BR /&gt;$h=1&lt;BR /&gt;echo $filesystem$i[$h]&lt;BR /&gt;producing "east" as output&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Thu, 23 Jun 2005 08:31:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569067#M830897</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-06-23T08:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569068#M830898</link>
      <description>What about using a variable to address the filesystem$i issue?&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;i=1&lt;BR /&gt;h=1&lt;BR /&gt;&lt;BR /&gt;FS=filesystem${i}&lt;BR /&gt;&lt;BR /&gt;echo ${FS[$h]}&lt;BR /&gt;north&lt;BR /&gt;&lt;BR /&gt;i=2&lt;BR /&gt;h=2&lt;BR /&gt;FS=filesystem${i}&lt;BR /&gt;&lt;BR /&gt;echo ${FS[$h]}&lt;BR /&gt;west</description>
      <pubDate>Thu, 23 Jun 2005 08:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569068#M830898</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-06-23T08:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569069#M830899</link>
      <description>Sorry, this is off-topic.&lt;BR /&gt;&lt;BR /&gt;Mark - nice to see your name on here again. Where've you been?&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Thu, 23 Jun 2005 09:01:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569069#M830899</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2005-06-23T09:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569070#M830900</link>
      <description>What I am actually trying to do is&lt;BR /&gt;&lt;BR /&gt;Outer Loop:-&lt;BR /&gt;&lt;BR /&gt;prompt the user for a server name&lt;BR /&gt;&lt;BR /&gt;Inner Loop:-&lt;BR /&gt;&lt;BR /&gt;Prompt the user for filesystems (1 at a time in this inner loop)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When all input has been gathered I want to display the information on screen&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;_______________________________________&lt;BR /&gt;Server:- "Server Name"&lt;BR /&gt;Filesystems:- "Filesystem" "Filesystem" ...&lt;BR /&gt;&lt;BR /&gt;Server:- "Server Name"&lt;BR /&gt;Filesystems:- "Filesystem" " Filesystem" ...&lt;BR /&gt;&lt;BR /&gt;etc...&lt;BR /&gt;_________________________________________&lt;BR /&gt;&lt;BR /&gt;Hope this makes my problem clearer.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 09:14:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569070#M830900</guid>
      <dc:creator>Brian Dore</dc:creator>
      <dc:date>2005-06-23T09:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569071#M830901</link>
      <description>I forgot to attach the script...</description>
      <pubDate>Fri, 24 Jun 2005 01:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569071#M830901</guid>
      <dc:creator>Bejoy C Alias</dc:creator>
      <dc:date>2005-06-24T01:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569072#M830902</link>
      <description>You can do it like this&lt;BR /&gt;&lt;BR /&gt;$ filesystem1[1]="north"&lt;BR /&gt;$ h=1&lt;BR /&gt;$ i=1&lt;BR /&gt;$ eval echo \${filesystem$i[\$h]}&lt;BR /&gt;north&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jun 2005 07:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569072#M830902</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-06-24T07:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569073#M830903</link>
      <description>Balle Balle.....&lt;BR /&gt;Brian.....Ermin's idea works.....</description>
      <pubDate>Sat, 25 Jun 2005 06:04:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-problem/m-p/3569073#M830903</guid>
      <dc:creator>Bejoy C Alias</dc:creator>
      <dc:date>2005-06-25T06:04:21Z</dc:date>
    </item>
  </channel>
</rss>

