<?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: loop counter script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122584#M802456</link>
    <description>initialise COUNT :&lt;BR /&gt;&lt;BR /&gt;typeset -i COUNT&lt;BR /&gt;COUNT=0&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;JL</description>
    <pubDate>Tue, 18 Nov 2003 14:33:07 GMT</pubDate>
    <dc:creator>Jean-Luc Oudart</dc:creator>
    <dc:date>2003-11-18T14:33:07Z</dc:date>
    <item>
      <title>loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122583#M802455</link>
      <description>How do you go about doing a loop that counts from 00001 to 99999&lt;BR /&gt;&lt;BR /&gt;This errors out...&lt;BR /&gt;&lt;BR /&gt;echo $COUNT&lt;BR /&gt;while [ "$COUNT" -lt "1" ]&lt;BR /&gt;do&lt;BR /&gt;        COUNT=`expr "$COUNT" + 00001`&lt;BR /&gt;#       echo $COUNT"," &amp;gt;&amp;gt; $DATAFILE&lt;BR /&gt;        echo $COUNT","&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 14:29:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122583#M802455</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2003-11-18T14:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122584#M802456</link>
      <description>initialise COUNT :&lt;BR /&gt;&lt;BR /&gt;typeset -i COUNT&lt;BR /&gt;COUNT=0&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;JL</description>
      <pubDate>Tue, 18 Nov 2003 14:33:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122584#M802456</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-11-18T14:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122585#M802457</link>
      <description>You havent initialized COUNT for a start...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;&lt;BR /&gt;Victor</description>
      <pubDate>Tue, 18 Nov 2003 14:36:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122585#M802457</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2003-11-18T14:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122586#M802458</link>
      <description>Sorry but newbie, intialize?&lt;BR /&gt;When I added to my script I get an error...&lt;BR /&gt; &lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;#Variables&lt;BR /&gt;DATAFILE=/tmp/count.file&lt;BR /&gt;initialize COUNT:&lt;BR /&gt;typeset -i COUNT&lt;BR /&gt;COUNT=0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#start script&lt;BR /&gt;#does counter equal 99999&lt;BR /&gt;echo $COUNT&lt;BR /&gt;while [ "$COUNT" -lt "1" ]&lt;BR /&gt;do&lt;BR /&gt;        COUNT=`expr "$COUNT" + 00001`&lt;BR /&gt;#       echo $COUNT"," &amp;gt;&amp;gt; $DATAFILE&lt;BR /&gt;        echo $COUNT","&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;./count_to.sh[20]: initialize:  not found.&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 14:40:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122586#M802458</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2003-11-18T14:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122587#M802459</link>
      <description>You don't need expr and you should avoid [ rather then [[. In the POSIX or Korn shell if [[ ]] is an internal test whereas if [] calls the external test command. Also (( .. )) is an implicit let for numeric operations.&lt;BR /&gt;&lt;BR /&gt;typeset -Z5 COUNT=1&lt;BR /&gt;typeset -Z5 STOP=99999&lt;BR /&gt;while [[ ${COUNT} -le ${STOP} ]]&lt;BR /&gt;  do&lt;BR /&gt;    echo "${COUNT},"&lt;BR /&gt;    (( COUNT +=1 ))&lt;BR /&gt;  done&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 14:41:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122587#M802459</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-11-18T14:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122588#M802460</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;initialize means setting a variable to a defined value, in your case COUNT=1.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 14:56:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loop-counter-script/m-p/3122588#M802460</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-18T14:56:43Z</dc:date>
    </item>
  </channel>
</rss>

