<?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: Problem with &amp;quot;while&amp;quot; loop in ksh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991370#M124445</link>
    <description>Stewart -&lt;BR /&gt;I changed " $STD " to "$STD" in the &lt;BR /&gt; grep " $STD " ${TEMP_FILE} | grep -q Sync &lt;BR /&gt;&lt;BR /&gt;This then worked.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;dl</description>
    <pubDate>Fri, 06 Jun 2003 19:43:54 GMT</pubDate>
    <dc:creator>Dave La Mar</dc:creator>
    <dc:date>2003-06-06T19:43:54Z</dc:date>
    <item>
      <title>Problem with "while" loop in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991366#M124441</link>
      <description>Please look at the code and output below.&lt;BR /&gt;&lt;BR /&gt;This script fails with a "while" loop, but works with a "for" loop.  Note in the output that the "exit 1" is executed, but the script doesn't stop.  Why is that?&lt;BR /&gt;&lt;BR /&gt;symbcv list &amp;gt; ${TEMP_FILE}&lt;BR /&gt;    #for STD in `awk '{print $1}' ${BCVFILE}`&lt;BR /&gt;    cat ${BCVFILE} | while read STD BCV&lt;BR /&gt;    do&lt;BR /&gt;        grep " $STD " ${TEMP_FILE} | grep -q Sync&lt;BR /&gt;        #  0 = true; 1 = false&lt;BR /&gt;        if [[ $? = 0 ]]&lt;BR /&gt;        then&lt;BR /&gt;            echo "ERROR: STD's in ${BCVFILE} are synched to another BCV." &amp;gt;&amp;gt; ${L&lt;BR /&gt;OG}&lt;BR /&gt;            grep " $STD " ${TEMP_FILE} | grep -v " $BCV " &amp;gt;&amp;gt; ${LOG}&lt;BR /&gt;            echo "Exiting at `date | awk '{print $4}'`." &amp;gt;&amp;gt; ${LOG}&lt;BR /&gt;            exit 1&lt;BR /&gt;        fi&lt;BR /&gt;    done&lt;BR /&gt;&lt;BR /&gt;    check_fs&lt;BR /&gt;    symmir -f ${BCVFILE} -sid ${SID} establish -noprompt &amp;gt;&amp;gt; ${LOG} 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;read STD BCV&lt;BR /&gt;+ symbcv list&lt;BR /&gt;+ 1&amp;gt; /tmp/bcv_ops.tmp&lt;BR /&gt;+ read STD BCV&lt;BR /&gt;+ cat /usr/local/bin/timefinder.try/bcv_files/tr2_bcv_file&lt;BR /&gt;+ grep  019  /tmp/bcv_ops.tmp&lt;BR /&gt;+ grep -q Sync&lt;BR /&gt;+ [[ 0 = 0 ]]&lt;BR /&gt;+ echo ERROR: STD's in /usr/local/bin/timefinder.try/bcv_files/tr2_bcv_file are synched to another BCV.&lt;BR /&gt;+ 1&amp;gt;&amp;gt; /var/opt/timefinder/logs/bcv_ops_tr2_sync.060603-1535.log&lt;BR /&gt;+ grep -v  140 &lt;BR /&gt;+ grep  019  /tmp/bcv_ops.tmp&lt;BR /&gt;+ 1&amp;gt;&amp;gt; /var/opt/timefinder/logs/bcv_ops_tr2_sync.060603-1535.log&lt;BR /&gt;+ awk {print $4}&lt;BR /&gt;+ date&lt;BR /&gt;+ echo Exiting at 15:35:12.&lt;BR /&gt;+ 1&amp;gt;&amp;gt; /var/opt/timefinder/logs/bcv_ops_tr2_sync.060603-1535.log&lt;BR /&gt;+ exit 1          &amp;lt;== executes but keeps on going ???&lt;BR /&gt;+ check_fs&lt;BR /&gt;+ echo vtr201&lt;BR /&gt;+ + ls /dev/vtr201&lt;BR /&gt;/dev/vtr201 not found&lt;BR /&gt;TEST_VOL=&lt;BR /&gt;+ [ -n  ]&lt;BR /&gt;+ symmir -f /usr/local/bin/timefinder.try/bcv_files/tr2_bcv_file -sid 0421 establish -noprompt&lt;BR /&gt;+ 1&amp;gt;&amp;gt; /var/opt/timefinder/logs/bcv_ops_tr2_sync.060603-1535.log 2&amp;gt;&amp;amp; 1&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 18:41:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991366#M124441</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-06-06T18:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with "while" loop in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991367#M124442</link>
      <description>because your reading in columns probably.&lt;BR /&gt;VAR1&lt;BR /&gt;VAR2&lt;BR /&gt;&lt;BR /&gt;try &lt;BR /&gt;VAR1 VAR2</description>
      <pubDate>Fri, 06 Jun 2003 19:34:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991367#M124442</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-06-06T19:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with "while" loop in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991368#M124443</link>
      <description>because your reading in columns probably.&lt;BR /&gt;VAR1&lt;BR /&gt;VAR2&lt;BR /&gt;&lt;BR /&gt;try &lt;BR /&gt;VAR1 VAR2</description>
      <pubDate>Fri, 06 Jun 2003 19:35:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991368#M124443</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-06-06T19:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with "while" loop in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991369#M124444</link>
      <description>No, thanks.  My data is rows:&lt;BR /&gt;019   13D&lt;BR /&gt;01A   13E&lt;BR /&gt;01B   13F&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jun 2003 19:38:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991369#M124444</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2003-06-06T19:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with "while" loop in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991370#M124445</link>
      <description>Stewart -&lt;BR /&gt;I changed " $STD " to "$STD" in the &lt;BR /&gt; grep " $STD " ${TEMP_FILE} | grep -q Sync &lt;BR /&gt;&lt;BR /&gt;This then worked.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;dl</description>
      <pubDate>Fri, 06 Jun 2003 19:43:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-quot-while-quot-loop-in-ksh/m-p/2991370#M124445</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-06-06T19:43:54Z</dc:date>
    </item>
  </channel>
</rss>

