<?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: Case-statement and variables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504992#M21402</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think that it fails because of the order in which the shell processes the case statement.&lt;BR /&gt;The first thing that it does is to split the lines into tokens that are serarated by the standard set of metacharacters:-&lt;BR /&gt;space tab newline ; ( ) &amp;lt; &amp;gt; | &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Later it performs parameter substitution on $POSSIBLE but this is too late for it to correctly handle the | characters.&lt;BR /&gt;&lt;BR /&gt;You can force the shell to re-evaluate the command with the 'eval' statement and indeed if you try:-&lt;BR /&gt;&lt;BR /&gt;eval "&lt;BR /&gt;&lt;YOUR case="" statement=""&gt;&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;then you get the result that you expected. Quoting of this form can cause problems though.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/YOUR&gt;</description>
    <pubDate>Wed, 14 Mar 2001 12:52:58 GMT</pubDate>
    <dc:creator>John Palmer</dc:creator>
    <dc:date>2001-03-14T12:52:58Z</dc:date>
    <item>
      <title>Case-statement and variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504989#M21399</link>
      <description>Why does this script respond whith "Wrong..." and "Right..." which I expected?&lt;BR /&gt;&lt;BR /&gt;export POSSIBLE="6.6.01|6.6.02"&lt;BR /&gt;export CURRENT="6.6.01"&lt;BR /&gt;case $CURRENT in&lt;BR /&gt;    $POSSIBLE)&lt;BR /&gt;        echo "Right $CURRENT"&lt;BR /&gt;        ;;&lt;BR /&gt;    (*)&lt;BR /&gt;        echo "Wrong $CURRENT"&lt;BR /&gt;esac&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2001 11:17:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504989#M21399</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-03-14T11:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Case-statement and variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504990#M21400</link>
      <description>why don't you switch around the 6.6.01 in the&lt;BR /&gt;first export which may explain it.&lt;BR /&gt;Who cares anyway... it works!&lt;BR /&gt;&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 14 Mar 2001 11:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504990#M21400</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-03-14T11:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Case-statement and variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504991#M21401</link>
      <description>Sorry. I typed too fast, I forgot the word "NOT".&lt;BR /&gt;I mean: Why does this script respond whith "Wrong..." and NOT whith "Right..." which I expected? &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2001 12:17:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504991#M21401</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-03-14T12:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Case-statement and variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504992#M21402</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think that it fails because of the order in which the shell processes the case statement.&lt;BR /&gt;The first thing that it does is to split the lines into tokens that are serarated by the standard set of metacharacters:-&lt;BR /&gt;space tab newline ; ( ) &amp;lt; &amp;gt; | &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Later it performs parameter substitution on $POSSIBLE but this is too late for it to correctly handle the | characters.&lt;BR /&gt;&lt;BR /&gt;You can force the shell to re-evaluate the command with the 'eval' statement and indeed if you try:-&lt;BR /&gt;&lt;BR /&gt;eval "&lt;BR /&gt;&lt;YOUR case="" statement=""&gt;&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;then you get the result that you expected. Quoting of this form can cause problems though.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/YOUR&gt;</description>
      <pubDate>Wed, 14 Mar 2001 12:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-and-variables/m-p/2504992#M21402</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2001-03-14T12:52:58Z</dc:date>
    </item>
  </channel>
</rss>

