<?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 Variable of variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246270#M891541</link>
    <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I want to use a for loop within a shell script to display the value of several variables, but I can't manage it. It shoul be something like that:&lt;BR /&gt;&lt;BR /&gt;for VAR in VAR1 VAR2 VAR3 ; do&lt;BR /&gt;  echo &lt;VALUE of="" the="" value="" of=""&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;/VALUE&gt;</description>
    <pubDate>Tue, 13 Apr 2004 05:44:07 GMT</pubDate>
    <dc:creator>Sylvain CROUET</dc:creator>
    <dc:date>2004-04-13T05:44:07Z</dc:date>
    <item>
      <title>Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246270#M891541</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I want to use a for loop within a shell script to display the value of several variables, but I can't manage it. It shoul be something like that:&lt;BR /&gt;&lt;BR /&gt;for VAR in VAR1 VAR2 VAR3 ; do&lt;BR /&gt;  echo &lt;VALUE of="" the="" value="" of=""&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;/VALUE&gt;</description>
      <pubDate>Tue, 13 Apr 2004 05:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246270#M891541</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-13T05:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246271#M891542</link>
      <description>Is this what you need?&lt;BR /&gt;&lt;BR /&gt;a=5&lt;BR /&gt;b=5&lt;BR /&gt;for var in a b&lt;BR /&gt;do&lt;BR /&gt;echo $var&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;sks&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Apr 2004 05:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246271#M891542</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-04-13T05:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246272#M891543</link>
      <description>Are the variables numeric and are you trying to get thier total? or create a loop that takes VAR and add it's value to VAR1 then VAR2 then VAR3?? &lt;BR /&gt;&lt;BR /&gt;Post additional info pls. Can you give us an example of what VAR, VAR1, VAR2 and VAR3 could be and your anticipated result.&lt;BR /&gt;&lt;BR /&gt;-denver&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Apr 2004 06:02:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246272#M891543</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2004-04-13T06:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246273#M891544</link>
      <description>No. I do not need the script to display the names of the variables (a and b), but their values (5 and 5).</description>
      <pubDate>Tue, 13 Apr 2004 06:03:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246273#M891544</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-13T06:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246274#M891545</link>
      <description>As I read ,&lt;BR /&gt;&lt;BR /&gt;you have the following setup in place&lt;BR /&gt;&lt;BR /&gt;export KAPS=KAPILRAJ&lt;BR /&gt;export KK=KAPS&lt;BR /&gt;&lt;BR /&gt;using KK , you want to get KAPILRAJ i.e. something like echo ${$KK} .. ?&lt;BR /&gt;&lt;BR /&gt;you may try the following&lt;BR /&gt;&lt;BR /&gt;echo $KK|awk '{print "echo","$"$0}' |ksh&lt;BR /&gt;&lt;BR /&gt;Please make sure that all the variables are exported i.e. export VAR1 VAR2&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Tue, 13 Apr 2004 06:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246274#M891545</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-04-13T06:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246275#M891546</link>
      <description>I just want to display the values of my variables, which are "strings".</description>
      <pubDate>Tue, 13 Apr 2004 06:06:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246275#M891546</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-13T06:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246276#M891547</link>
      <description>Can u explain in detail please .......&lt;BR /&gt;&lt;BR /&gt;An echo $VAR will show the value only !!&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Tue, 13 Apr 2004 06:12:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246276#M891547</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-04-13T06:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246277#M891548</link>
      <description>Check the following:&lt;BR /&gt;&lt;BR /&gt;a=abc&lt;BR /&gt;b=def&lt;BR /&gt;for var in $a $b&lt;BR /&gt;do&lt;BR /&gt;echo $var&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Tue, 13 Apr 2004 06:17:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246277#M891548</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-04-13T06:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246278#M891549</link>
      <description>VAR1=is&lt;BR /&gt;VAR2=this&lt;BR /&gt;VAR3=it&lt;BR /&gt;&lt;BR /&gt;for VAR in $VAR1 $VAR2 $VAR3; do&lt;BR /&gt;echo $VAR&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;   or??&lt;BR /&gt;&lt;BR /&gt;VAR1=is&lt;BR /&gt;VAR2=this&lt;BR /&gt;VAR3=it&lt;BR /&gt;&lt;BR /&gt;VAR="$VAR1 $VAR2 $VAR3"&lt;BR /&gt;echo $VAR&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Apr 2004 06:18:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246278#M891549</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2004-04-13T06:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246279#M891550</link>
      <description>What about the following:&lt;BR /&gt;&lt;BR /&gt;A="this is 1"&lt;BR /&gt;B="This is 2"&lt;BR /&gt;&lt;BR /&gt;for i in "$A" "$B"&lt;BR /&gt;do&lt;BR /&gt;echo $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Tue, 13 Apr 2004 06:21:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246279#M891550</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-04-13T06:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246280#M891551</link>
      <description>Many replies at the same time.&lt;BR /&gt;Note that quotes are essential if your variable values contain multiple words.&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Tue, 13 Apr 2004 06:26:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246280#M891551</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-04-13T06:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246281#M891552</link>
      <description>The solution using $VAR1, $VAR2... directly within the "in" statement is quite interesting, but what if I want to print:&lt;BR /&gt;  &lt;NAME_OF_VARI&gt; = &lt;VALUE_OF_VARI&gt;&lt;/VALUE_OF_VARI&gt;&lt;/NAME_OF_VARI&gt;</description>
      <pubDate>Tue, 13 Apr 2004 07:45:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246281#M891552</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-13T07:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246282#M891553</link>
      <description>for var in var1 var2&lt;BR /&gt;do&lt;BR /&gt;eval print "$var = \$$var"&lt;BR /&gt;done</description>
      <pubDate>Tue, 13 Apr 2004 09:56:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246282#M891553</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-04-13T09:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variable of variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246283#M891554</link>
      <description>Thanks Curt! That was the solution I was looking for.</description>
      <pubDate>Tue, 13 Apr 2004 10:11:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-of-variable/m-p/3246283#M891554</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2004-04-13T10:11:56Z</dc:date>
    </item>
  </channel>
</rss>

