<?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: Increment a variable name in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153712#M683940</link>
    <description>Hi (again) :&lt;BR /&gt;&lt;BR /&gt;Sorry, there's a typo.  My post should be:&lt;BR /&gt;&lt;BR /&gt;# X=1&lt;BR /&gt;# echo ${X}&lt;BR /&gt;1&lt;BR /&gt;X X=$((X+1))&lt;BR /&gt;# echo ${X}&lt;BR /&gt;2&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Fri, 30 Jan 2009 14:42:25 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-01-30T14:42:25Z</dc:date>
    <item>
      <title>Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153710#M683938</link>
      <description>How could I take a variable name's that contains a number at the end and increment the number part? This is possible in basic, I would think Unix scripts would allow it too but it always fails.&lt;BR /&gt;simple example&lt;BR /&gt;count = 0&lt;BR /&gt;count=`expr $count + 1` &lt;BR /&gt;# 1st time thru count would be equal to 1&lt;BR /&gt;&lt;BR /&gt;tm$count="69"&lt;BR /&gt;echo $tm1&lt;BR /&gt;&lt;BR /&gt;$tm1 fails and does not exist</description>
      <pubDate>Fri, 30 Jan 2009 14:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153710#M683938</guid>
      <dc:creator>UXisCool</dc:creator>
      <dc:date>2009-01-30T14:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153711#M683939</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;More effieiently, since using 'expr' spawns another process, use the shell's arithmetic abilities:&lt;BR /&gt;&lt;BR /&gt;# X=1&lt;BR /&gt;# echo ${X{&lt;BR /&gt;1&lt;BR /&gt;X X=$((X+1))&lt;BR /&gt;# echo ${X}&lt;BR /&gt;2&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 14:40:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153711#M683939</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-01-30T14:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153712#M683940</link>
      <description>Hi (again) :&lt;BR /&gt;&lt;BR /&gt;Sorry, there's a typo.  My post should be:&lt;BR /&gt;&lt;BR /&gt;# X=1&lt;BR /&gt;# echo ${X}&lt;BR /&gt;1&lt;BR /&gt;X X=$((X+1))&lt;BR /&gt;# echo ${X}&lt;BR /&gt;2&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 14:42:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153712#M683940</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-01-30T14:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153713#M683941</link>
      <description>jrf....&lt;BR /&gt;&lt;BR /&gt;I think you missed what he's looking for,&lt;BR /&gt;&lt;BR /&gt;he appears to want to generate named variables in the  form of &lt;BR /&gt;x1, x2 , x3...x&lt;SOME&gt; by incrementing some varible.&lt;BR /&gt;&lt;BR /&gt;something along the lines of:&lt;BR /&gt;&lt;BR /&gt;typeset -i cnt&lt;BR /&gt;cnt=0&lt;BR /&gt;&lt;BR /&gt;eval tm$cnt=a&lt;BR /&gt;cnt=$cnt+1&lt;BR /&gt;eval tm$cnt=b&lt;BR /&gt;echo $tm0 $tm1&lt;BR /&gt;&lt;/SOME&gt;</description>
      <pubDate>Fri, 30 Jan 2009 14:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153713#M683941</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-01-30T14:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153714#M683942</link>
      <description>Old School hit the nail on the head of what I was looking for. I tried to submit you 10 points ... somehow it changed to 8 when I had scrolled down but THANKS!!!!!</description>
      <pubDate>Fri, 30 Jan 2009 15:01:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153714#M683942</guid>
      <dc:creator>UXisCool</dc:creator>
      <dc:date>2009-01-30T15:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a variable name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153715#M683943</link>
      <description>ksh and other shells also support arrays (i.e. subscripted variables) that might be easier to manage....&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 15:37:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-variable-name/m-p/5153715#M683943</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-01-30T15:37:47Z</dc:date>
    </item>
  </channel>
</rss>

