<?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 loop question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278911#M640686</link>
    <description>lol ... ahh  nothing like getting on the band wagon for a good old tar and feathering. I guess Ill just have to be more explicit next time...but fab answers.&lt;BR /&gt;&lt;BR /&gt;Ok so "all hell breaks loose" was at tabd melodramatic. The new chastized me now says:&lt;BR /&gt;&lt;BR /&gt;My previous efforts hitherto produced an array of results ranging from $i being equal to each entry in the group of elements or $i being equal to the entire string. These observations were when I assigned the groups to an array, albeit , incorrectly. &lt;BR /&gt;&lt;BR /&gt;I see from the above how to correctly assign grouped elements to a variable to be used in the for loop.&lt;BR /&gt;&lt;BR /&gt;Thks for all your comments and help.</description>
    <pubDate>Fri, 08 Apr 2011 02:22:53 GMT</pubDate>
    <dc:creator>hpuxrocks</dc:creator>
    <dc:date>2011-04-08T02:22:53Z</dc:date>
    <item>
      <title>for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278905#M640680</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I have 3 values, each comprising 3 elements.&lt;BR /&gt;On the command line:&lt;BR /&gt;&lt;BR /&gt;for i in '1 2 3' '4 5 6' '7 8 9' etc works&lt;BR /&gt;&lt;BR /&gt;but in a script all hell breaks loose.&lt;BR /&gt;&lt;BR /&gt;can anyone assist pls ?&lt;BR /&gt;&lt;BR /&gt;I would like to run this within a script but Ive tried "'1 2 3' '4 5 6' '7 8 9' " and ''1 2 3' '4 5 6' '7 8 9' ' ...and both dont work.&lt;BR /&gt;&lt;BR /&gt;Thks in advance</description>
      <pubDate>Thu, 07 Apr 2011 13:22:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278905#M640680</guid>
      <dc:creator>hpuxrocks</dc:creator>
      <dc:date>2011-04-07T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278906#M640681</link>
      <description>sorry ...I forgot to add that within a script it DOES work but I would like to create a variable ..so&lt;BR /&gt;&lt;BR /&gt;elements="'123' '456' '789'"&lt;BR /&gt;&lt;BR /&gt;and then do&lt;BR /&gt;&lt;BR /&gt;for i in $elements ....&lt;BR /&gt;&lt;BR /&gt;this is the bit that goes wrong.&lt;BR /&gt;Id like to setup a var in case I have a huge number of elements - thks and sorry for the confusion</description>
      <pubDate>Thu, 07 Apr 2011 13:25:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278906#M640681</guid>
      <dc:creator>hpuxrocks</dc:creator>
      <dc:date>2011-04-07T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278907#M640682</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; but in a script all hell breaks loose.&lt;BR /&gt;&lt;BR /&gt;That's a useless description.  Show us the script (or better an example case with code) and describe what you want to do and what does happen.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Apr 2011 13:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278907#M640682</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-04-07T13:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278908#M640683</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;Do you mean this?&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;list1="123"&lt;BR /&gt;list2="456"&lt;BR /&gt;list3="789"&lt;BR /&gt;elements="${list1} ${list2} ${list3}"&lt;BR /&gt;for i in ${elements}&lt;BR /&gt;do&lt;BR /&gt;    echo ${i}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Apr 2011 15:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278908#M640683</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-04-07T15:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278909#M640684</link>
      <description>&amp;gt;I have a huge number of elements&lt;BR /&gt;&lt;BR /&gt;You could create an array if there aren't more than 1023 elements:&lt;BR /&gt;set -A elements '123' '456' '789'&lt;BR /&gt;&lt;BR /&gt;&amp;gt;for i in $elements ....&lt;BR /&gt;&lt;BR /&gt;Replace by:&lt;BR /&gt;for i in "${elements[@]}"; do&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Apr 2011 18:02:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278909#M640684</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-04-07T18:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278910#M640685</link>
      <description>&lt;!--!*#--&gt;&amp;gt; but in a script all hell breaks loose.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; this is the bit that goes wrong.&lt;BR /&gt;&lt;BR /&gt;Have you considered the possible advantages&lt;BR /&gt;of explaining what you're actually doing, and&lt;BR /&gt;what actually goes wrong when you do it?</description>
      <pubDate>Thu, 07 Apr 2011 23:45:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278910#M640685</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-04-07T23:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278911#M640686</link>
      <description>lol ... ahh  nothing like getting on the band wagon for a good old tar and feathering. I guess Ill just have to be more explicit next time...but fab answers.&lt;BR /&gt;&lt;BR /&gt;Ok so "all hell breaks loose" was at tabd melodramatic. The new chastized me now says:&lt;BR /&gt;&lt;BR /&gt;My previous efforts hitherto produced an array of results ranging from $i being equal to each entry in the group of elements or $i being equal to the entire string. These observations were when I assigned the groups to an array, albeit , incorrectly. &lt;BR /&gt;&lt;BR /&gt;I see from the above how to correctly assign grouped elements to a variable to be used in the for loop.&lt;BR /&gt;&lt;BR /&gt;Thks for all your comments and help.</description>
      <pubDate>Fri, 08 Apr 2011 02:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278911#M640686</guid>
      <dc:creator>hpuxrocks</dc:creator>
      <dc:date>2011-04-08T02:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: for loop question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278912#M640687</link>
      <description>thks to all</description>
      <pubDate>Fri, 08 Apr 2011 02:23:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-question/m-p/5278912#M640687</guid>
      <dc:creator>hpuxrocks</dc:creator>
      <dc:date>2011-04-08T02:23:51Z</dc:date>
    </item>
  </channel>
</rss>

