<?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: for in shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860942#M721518</link>
    <description>i=0&lt;BR /&gt;while [ $i != 10000 ]      &lt;BR /&gt;do&lt;BR /&gt;    let i=i+1&lt;BR /&gt;    &lt;COMMANDS&gt;     &lt;BR /&gt;done&lt;BR /&gt;&lt;/COMMANDS&gt;</description>
    <pubDate>Tue, 10 Dec 2002 15:59:34 GMT</pubDate>
    <dc:creator>Paul Sperry</dc:creator>
    <dc:date>2002-12-10T15:59:34Z</dc:date>
    <item>
      <title>for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860934#M721510</link>
      <description>Hello:&lt;BR /&gt;&lt;BR /&gt;   A very easy question, how can I make a for loop with a range of numbers. I mean:&lt;BR /&gt;&lt;BR /&gt;   for i in [0-10000]&lt;BR /&gt;   do &lt;BR /&gt;   ...........&lt;BR /&gt;   done&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 10 Dec 2002 10:04:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860934#M721510</guid>
      <dc:creator>oiram</dc:creator>
      <dc:date>2002-12-10T10:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860935#M721511</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;rather use while or until :&lt;BR /&gt;&lt;BR /&gt;I=0&lt;BR /&gt;while [ $i -lt 10000 ]&lt;BR /&gt;do&lt;BR /&gt;...&lt;BR /&gt;I=$(($I + 1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 10 Dec 2002 10:17:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860935#M721511</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-10T10:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860936#M721512</link>
      <description>let x=0&lt;BR /&gt;while [ $x -lt 10000 ]&lt;BR /&gt;do&lt;BR /&gt;  &lt;COMMAND&gt; &lt;BR /&gt;  let x=$x+1&lt;BR /&gt;done&lt;BR /&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Tue, 10 Dec 2002 10:18:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860936#M721512</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-12-10T10:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860937#M721513</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This answer is for ksh.&lt;BR /&gt;I don't know by heart how to use for without using a function, but you can do it with a while loop:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;let i=1&lt;BR /&gt;while [[i -le 1000 ]]&lt;BR /&gt;do&lt;BR /&gt;let i=${i}+1&lt;BR /&gt;echo ${i}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Fran??ois-Xavier&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2002 10:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860937#M721513</guid>
      <dc:creator>F. X. de Montgolfier</dc:creator>
      <dc:date>2002-12-10T10:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860938#M721514</link>
      <description>Using shell integer variables, the syntax is...&lt;BR /&gt;&lt;BR /&gt;let I=0&lt;BR /&gt;while (( I &amp;lt;= 10000 ));&lt;BR /&gt;do&lt;BR /&gt;...&lt;BR /&gt;let I=I+1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Tue, 10 Dec 2002 10:35:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860938#M721514</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-12-10T10:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860939#M721515</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;i=0 &lt;BR /&gt;while($i -le 10000) &lt;BR /&gt;do &lt;BR /&gt;... &lt;BR /&gt;i=($i + 1) &lt;BR /&gt;done &lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2002 10:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860939#M721515</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2002-12-10T10:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860940#M721516</link>
      <description>if also can be used&lt;BR /&gt;&lt;BR /&gt;A=0&lt;BR /&gt;if [ $A -gt 100000 ]&lt;BR /&gt;then&lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;A=`echo " $A + 1 " |bc`&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;kaps</description>
      <pubDate>Tue, 10 Dec 2002 10:38:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860940#M721516</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2002-12-10T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860941#M721517</link>
      <description>If you're running a (t)csh, you can use repeat&lt;BR /&gt;&lt;BR /&gt;% repeat 10000 echo help&lt;BR /&gt;&lt;BR /&gt;In the (k)sh you can fake this with a function&lt;BR /&gt;&lt;BR /&gt;a5:/u/usr/merijn 102 &amp;gt; ksh&lt;BR /&gt;$ repeat () {&lt;BR /&gt;&amp;gt; let i=$1&lt;BR /&gt;&amp;gt; shift&lt;BR /&gt;&amp;gt; while [ $i -gt 0 ]; do&lt;BR /&gt;&amp;gt;   $@&lt;BR /&gt;&amp;gt;   let i=`expr $i - 1`&lt;BR /&gt;&amp;gt;   done&lt;BR /&gt;&amp;gt;   }&lt;BR /&gt;$ repeat 3 echo help&lt;BR /&gt;help&lt;BR /&gt;help&lt;BR /&gt;help&lt;BR /&gt;$&lt;BR /&gt;Exit 1&lt;BR /&gt;a5:/u/usr/merijn 103 &amp;gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2002 10:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860941#M721517</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-12-10T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860942#M721518</link>
      <description>i=0&lt;BR /&gt;while [ $i != 10000 ]      &lt;BR /&gt;do&lt;BR /&gt;    let i=i+1&lt;BR /&gt;    &lt;COMMANDS&gt;     &lt;BR /&gt;done&lt;BR /&gt;&lt;/COMMANDS&gt;</description>
      <pubDate>Tue, 10 Dec 2002 15:59:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860942#M721518</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2002-12-10T15:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: for in shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860943#M721519</link>
      <description>Just to increase the noise,&lt;BR /&gt;here another Bash feature:&lt;BR /&gt;&lt;BR /&gt;$ echo $0&lt;BR /&gt;-bash&lt;BR /&gt;$ for ((i=0; i&amp;lt;10; i++));do printf "%3u Bash lets you do C-like loops\n" $i;don&lt;BR /&gt;e&lt;BR /&gt;  0 Bash lets you do C-like loops&lt;BR /&gt;  1 Bash lets you do C-like loops&lt;BR /&gt;  2 Bash lets you do C-like loops&lt;BR /&gt;  3 Bash lets you do C-like loops&lt;BR /&gt;  4 Bash lets you do C-like loops&lt;BR /&gt;  5 Bash lets you do C-like loops&lt;BR /&gt;  6 Bash lets you do C-like loops&lt;BR /&gt;  7 Bash lets you do C-like loops&lt;BR /&gt;  8 Bash lets you do C-like loops&lt;BR /&gt;  9 Bash lets you do C-like loops&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2002 16:08:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-in-shell/m-p/2860943#M721519</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-12-10T16:08:50Z</dc:date>
    </item>
  </channel>
</rss>

