<?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: while loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885434#M704495</link>
    <description>Does a hog like slop?&lt;BR /&gt;&lt;BR /&gt;OK=0&lt;BR /&gt;until [[ ${OK} -ne 0 ]]&lt;BR /&gt;  do&lt;BR /&gt;    read pe&lt;BR /&gt;    case "${pe}" in&lt;BR /&gt;      4|8|16|32) OK=1&lt;BR /&gt;                 ;;&lt;BR /&gt;              *) echo "Invalid input" &amp;gt;&amp;amp;2&lt;BR /&gt;                 ;;&lt;BR /&gt;    esac&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;for i ....</description>
    <pubDate>Fri, 11 Feb 2005 16:44:40 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-02-11T16:44:40Z</dc:date>
    <item>
      <title>while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885430#M704491</link>
      <description>I am using this for loop to create volume groups and it works just fine, but if an admin types something else besides 4,8,16 or 32, it will blow up. How can I setup a while loop to make sure they only input 4,8,16,32&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo -n "Please enter the number of physcial extents for the vgcreate (4,8,16, etc): "&lt;BR /&gt;read pe&lt;BR /&gt;for i in 2 3 4 5 6&lt;BR /&gt;do&lt;BR /&gt;echo "...Creating volume group vg0$i..."&lt;BR /&gt;vgcreate -s $pe $i `cat $target_dir/vg0$i.out`&lt;BR /&gt;done</description>
      <pubDate>Fri, 11 Feb 2005 15:33:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885430#M704491</guid>
      <dc:creator>Donald C Nelson</dc:creator>
      <dc:date>2005-02-11T15:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885431#M704492</link>
      <description>read pe&lt;BR /&gt;after this add&lt;BR /&gt;if [ ${pe} -eq "4" -o ${pe} -eq "8" -o ${pe} -eq "16" -o ${pe} -eq "32" ];then&lt;BR /&gt;for i in 2 3 4 5 6&lt;BR /&gt;do&lt;BR /&gt;echo "...Creating volume group vg0$i..."&lt;BR /&gt;vgcreate -s $pe $i `cat $target_dir/vg0$i.out`&lt;BR /&gt;done&lt;BR /&gt;else&lt;BR /&gt;echo "bad Choice"&lt;BR /&gt;exit 1&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2005 15:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885431#M704492</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-02-11T15:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885432#M704493</link>
      <description>There are a number of ways to attack this but the case statement is an easy approach:&lt;BR /&gt;&lt;BR /&gt;read pe&lt;BR /&gt;case "${pe}" in&lt;BR /&gt;  4|8|16|32);;&lt;BR /&gt;          *) echo "Invalid input" &amp;gt;&amp;amp;2&lt;BR /&gt;             exit 255;;&lt;BR /&gt;esac&lt;BR /&gt;for i ....&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2005 15:49:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885432#M704493</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-11T15:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885433#M704494</link>
      <description>The case statement will work for me. Thanks&lt;BR /&gt;Clay, but I need for it to loop back to another response. Is there a command I can put in after the "Invalid Choice"</description>
      <pubDate>Fri, 11 Feb 2005 15:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885433#M704494</guid>
      <dc:creator>Donald C Nelson</dc:creator>
      <dc:date>2005-02-11T15:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885434#M704495</link>
      <description>Does a hog like slop?&lt;BR /&gt;&lt;BR /&gt;OK=0&lt;BR /&gt;until [[ ${OK} -ne 0 ]]&lt;BR /&gt;  do&lt;BR /&gt;    read pe&lt;BR /&gt;    case "${pe}" in&lt;BR /&gt;      4|8|16|32) OK=1&lt;BR /&gt;                 ;;&lt;BR /&gt;              *) echo "Invalid input" &amp;gt;&amp;amp;2&lt;BR /&gt;                 ;;&lt;BR /&gt;    esac&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;for i ....</description>
      <pubDate>Fri, 11 Feb 2005 16:44:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885434#M704495</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-02-11T16:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885435#M704496</link>
      <description>Thanks Clay, right when I sent the reply, I found my answer.</description>
      <pubDate>Fri, 11 Feb 2005 16:49:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop/m-p/4885435#M704496</guid>
      <dc:creator>Donald C Nelson</dc:creator>
      <dc:date>2005-02-11T16:49:38Z</dc:date>
    </item>
  </channel>
</rss>

