<?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: Script error; IF, ELSE, ENDIF in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28375#M4370</link>
    <description>I'd check again after correcting the first error. The second errors look like they probably came from the "if" line erroring out.</description>
    <pubDate>Tue, 21 Jun 2016 20:48:00 GMT</pubDate>
    <dc:creator>BrandonC</dc:creator>
    <dc:date>2016-06-21T20:48:00Z</dc:date>
    <item>
      <title>Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28373#M4368</link>
      <description>I'm newbie in scripts. &lt;BR /&gt;
We reconfigure our network and I try make write script for that.&lt;BR /&gt;
my simple script is:&lt;BR /&gt;
set var vlanName $CLI.ARGV1&lt;BR /&gt;
set var vlanDesc $CLI.ARGV2&lt;BR /&gt;
set var tag $CLI.ARGV3&lt;BR /&gt;
set var trunkport $CLI.ARGV4&lt;BR /&gt;
if ($CLI.ARGC ! = 0) then&lt;BR /&gt;
create vlan $vlanName description $vlanDesc&lt;BR /&gt;
configure $vlanName tag $tag&lt;BR /&gt;
configure $vlanName add ports $trunkport tagged&lt;BR /&gt;
enable $vlanName&lt;BR /&gt;
else&lt;BR /&gt;
create log entry "error with $vlanName"&lt;BR /&gt;
endifWhen I load script with 4 arguments and get errors:&lt;BR /&gt;
&lt;I&gt;* switch1.7 # load script createvlan.xsf vlan11 gram 11 46&lt;BR /&gt;
&lt;/I&gt;&lt;B&gt;Error:syntax error in expression "(4 ! = 0)"&lt;BR /&gt;
&lt;/B&gt;&lt;B&gt;Error: Mismatched ELSE&lt;BR /&gt;
&lt;/B&gt;&lt;B&gt;Error: Mismatched ENDIF&lt;BR /&gt;
&lt;/B&gt;additional information: &lt;BR /&gt;
&lt;I&gt;* switch1.8 # show version&lt;BR /&gt;
&lt;/I&gt;Switch      : 800243-00-03 1031G-80649 Rev 3.0 BootROM: 1.0.3.5    IMG: 12.6.2.10&lt;BR /&gt;
XGM2-1      :&lt;BR /&gt;
Image   : ExtremeXOS version 12.6.2.10 v1262b10-patch1-15 by release-manager on Tue Jun 5 19:05:37 EDT 2012&lt;BR /&gt;
BootROM : 1.0.3.5&lt;BR /&gt;
&lt;I&gt;* switch1.9 # show switch&lt;BR /&gt;
&lt;/I&gt;System Type:      X350-48t&lt;BR /&gt;
&lt;I&gt;* switch1.10 # show licenses&lt;BR /&gt;
&lt;/I&gt;Enabled License Level:        L2 Edge&lt;BR /&gt;
Enabled Feature Packs:        Noneand surprisingly is that - after script execute it really create new vlan like I want, but these errors are confused me. and that indicate on my misunderstanding about this simple script. &lt;BR /&gt;
without understanding simple i can't dig deeper  &lt;BR /&gt;
&lt;BR /&gt;
Q in simple - why I get:&lt;BR /&gt;
&lt;B&gt;Error:syntax error in expression "(4 ! = 0)"&lt;/B&gt;&lt;BR /&gt;
&lt;B&gt;Error: Mismatched ENDIF  &lt;/B&gt;&lt;B&gt;Error: Mismatched ELSE&lt;/B&gt;&lt;BR /&gt;
Thanks,</description>
      <pubDate>Tue, 21 Jun 2016 20:33:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28373#M4368</guid>
      <dc:creator>modris_bernands</dc:creator>
      <dc:date>2016-06-21T20:33:00Z</dc:date>
    </item>
    <item>
      <title>RE: Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28374#M4369</link>
      <description>Hi Modris,&lt;BR /&gt;
&lt;BR /&gt;
For the first error, make sure that "! =" is together. It should be "!=" instead (without the quotes)</description>
      <pubDate>Tue, 21 Jun 2016 20:48:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28374#M4369</guid>
      <dc:creator>BradP</dc:creator>
      <dc:date>2016-06-21T20:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28375#M4370</link>
      <description>I'd check again after correcting the first error. The second errors look like they probably came from the "if" line erroring out.</description>
      <pubDate>Tue, 21 Jun 2016 20:48:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28375#M4370</guid>
      <dc:creator>BrandonC</dc:creator>
      <dc:date>2016-06-21T20:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28376#M4371</link>
      <description>Yes, Brad, You are right... remove spaces and all error is gone (for now  ).&lt;BR /&gt;
&lt;BR /&gt;
thank You for help&lt;BR /&gt;
&lt;BR /&gt;
Possible I was fail becaus of example in EXOSCommandRef12_5.book.pdf &lt;BR /&gt;
&lt;BR /&gt;
IF ($x &amp;gt; 2) THENshow switch&lt;BR /&gt;
ELSE&lt;BR /&gt;
show vlan&lt;BR /&gt;
ENDIF&lt;BR /&gt;
and there are space on both side from "&amp;gt;", but maybe it is complete different situation. As I mention I'm complete novice in scripting </description>
      <pubDate>Wed, 22 Jun 2016 02:29:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28376#M4371</guid>
      <dc:creator>modris_bernands</dc:creator>
      <dc:date>2016-06-22T02:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28377#M4372</link>
      <description>The &amp;gt; and != are your single operand. The switch doesn't understand what "! =" means, but it does understand "!=". I'm glad I could help. The important part is that you're taking the leap. You'll very, very rarely get a script right on the first try--but through practice, you'll get a lot better at it. &lt;BR /&gt;
&lt;BR /&gt;
Good job!</description>
      <pubDate>Wed, 22 Jun 2016 02:29:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28377#M4372</guid>
      <dc:creator>BradP</dc:creator>
      <dc:date>2016-06-22T02:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: Script error; IF, ELSE, ENDIF</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28378#M4373</link>
      <description>Modris,&lt;BR /&gt;
&lt;BR /&gt;
I tested the following script using your args and it works:&lt;BR /&gt;
&lt;BR /&gt;
set var vlanName $CLI.ARGV1set var vlanDesc $CLI.ARGV2&lt;BR /&gt;
set var tag $CLI.ARGV3&lt;BR /&gt;
set var trunkport $CLI.ARGV4&lt;BR /&gt;
if ($CLI.ARGC != 0) then&lt;BR /&gt;
        create vlan $vlanName description $vlanDesc&lt;BR /&gt;
        configure $vlanName tag $tag&lt;BR /&gt;
        configure $vlanName add ports $trunkport tagged&lt;BR /&gt;
        enable $vlanName&lt;BR /&gt;
else&lt;BR /&gt;
        create log entry "error with $vlanName"&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
I think the only notable change (other than the tabs for readability) is the one Brad mentioned above.&lt;BR /&gt;
&lt;BR /&gt;
You may want to consider changing if ($CLI.ARGC != 0) to if ($CLI.ARGC == 4) or some other form of argument error handling, as you really need all 4 arguments to execute this script without error.</description>
      <pubDate>Wed, 22 Jun 2016 02:46:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/script-error-if-else-endif/m-p/28378#M4373</guid>
      <dc:creator>Chad_Smith1</dc:creator>
      <dc:date>2016-06-22T02:46:00Z</dc:date>
    </item>
  </channel>
</rss>

