<?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: Using variables in &amp;quot;alias&amp;quot; definition in exshrc.xsf in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63113#M17993</link>
    <description>Ok, replying to my own question... I found a rather ugly solution. From exshrc.xsf, I simply call another script, in this case I called it aliases.xsf. In there, I could define the aliases:&lt;BR /&gt;
&lt;BR /&gt;
exshrc.xsf:&lt;BR /&gt;
run script aliases.xsf&lt;BR /&gt;
&lt;BR /&gt;
aliases.xsf:&lt;BR /&gt;
set var PORTS "1:1,1:2,1:3"&lt;BR /&gt;
alias shp "show port $PORTS inf"&lt;BR /&gt;
alias shprx "show port $PORTS rxerrors no-refresh"&lt;BR /&gt;
&lt;BR /&gt;
If anyone has an idea on how to make this work in the exshrc file, I'd appreciate some input!&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik</description>
    <pubDate>Tue, 06 Aug 2019 19:44:12 GMT</pubDate>
    <dc:creator>FredrikB</dc:creator>
    <dc:date>2019-08-06T19:44:12Z</dc:date>
    <item>
      <title>Using variables in "alias" definition in exshrc.xsf</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63112#M17992</link>
      <description>Hi!&lt;BR /&gt;
&lt;BR /&gt;
We want to define aliases using the script exshrc.xsf that is run every time a user logs in. Simple aliases are OK, but we want to create a variable with the most interesting ports and base aliases off that variable, like this:&lt;BR /&gt;
&lt;BR /&gt;
set var PORTS "1:1,1:2,1:3"&lt;BR /&gt;
alias shp "show port $PORTS inf"&lt;BR /&gt;
&lt;BR /&gt;
After logging in, this won't work, but if I run the script using the run script command, it works as intended:&lt;BR /&gt;
&lt;BR /&gt;
Slot-1 VPEX d123c.1 # shp&lt;BR /&gt;
 ^&lt;BR /&gt;
%% Invalid slot number detected at '^' marker.&lt;BR /&gt;
%% Parse error in alias command definition.&lt;BR /&gt;
Slot-1 VPEX d123c.2 # alias&lt;BR /&gt;
alias shp='show port $PORTS inf'&lt;BR /&gt;
Slot-1 VPEX d123c.3 # run script exshrc.xsf&lt;BR /&gt;
Slot-1 VPEX d123c.4 # alias&lt;BR /&gt;
alias shp='show port 1:1,1:2,1:3 inf'&lt;BR /&gt;
Slot-1 VPEX d123c.5 #&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have a suggestion on how to make this work upon login and auto-execution of the exshrx.xsf?&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik&lt;BR /&gt;
&lt;BR /&gt;
PS this is on an X590-24x-1q-2c running EXOS 30.2, but should be the same in any modern EXOS (21.x or above).</description>
      <pubDate>Tue, 30 Jul 2019 21:41:03 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63112#M17992</guid>
      <dc:creator>FredrikB</dc:creator>
      <dc:date>2019-07-30T21:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in "alias" definition in exshrc.xsf</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63113#M17993</link>
      <description>Ok, replying to my own question... I found a rather ugly solution. From exshrc.xsf, I simply call another script, in this case I called it aliases.xsf. In there, I could define the aliases:&lt;BR /&gt;
&lt;BR /&gt;
exshrc.xsf:&lt;BR /&gt;
run script aliases.xsf&lt;BR /&gt;
&lt;BR /&gt;
aliases.xsf:&lt;BR /&gt;
set var PORTS "1:1,1:2,1:3"&lt;BR /&gt;
alias shp "show port $PORTS inf"&lt;BR /&gt;
alias shprx "show port $PORTS rxerrors no-refresh"&lt;BR /&gt;
&lt;BR /&gt;
If anyone has an idea on how to make this work in the exshrc file, I'd appreciate some input!&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik</description>
      <pubDate>Tue, 06 Aug 2019 19:44:12 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63113#M17993</guid>
      <dc:creator>FredrikB</dc:creator>
      <dc:date>2019-08-06T19:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in "alias" definition in exshrc.xsf</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63114#M17994</link>
      <description>Hi &lt;USER-MENTION data-id="9867978"&gt;@FredrikB&lt;/USER-MENTION&gt;,&lt;BR /&gt;
Would you mind opening a case with GTAC so this behavior can be reviewed by Engineering? It sounds like the order of operations is a little off on the execution of the exshrc.xsf script.</description>
      <pubDate>Tue, 06 Aug 2019 22:10:57 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63114#M17994</guid>
      <dc:creator>Drew_C</dc:creator>
      <dc:date>2019-08-06T22:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in "alias" definition in exshrc.xsf</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63115#M17995</link>
      <description>Hi Drew!&lt;BR /&gt;
&lt;BR /&gt;
I opened a case (01897234 if you want to have a look) and was recommended the "enable cli scripting permanent" command, but I found that changing the exshrc.xsf script to this worked as I wanted:&lt;BR /&gt;
&lt;BR /&gt;
enable cli scripting&lt;BR /&gt;
set var PORTS "1:1,1:2,1:3"&lt;BR /&gt;
alias shp "show port $PORTS inf"&lt;BR /&gt;
alias shprx "show port $PORTS rxerrors no-refresh"&lt;BR /&gt;
&lt;BR /&gt;
The main use for this function is to list only ports that are relevant in 40 and 100 G switches like the X870. When not using any break-out cables, every 3 of 4 interfaces will always be down and setting the $PORTS variable to 1,5,9,13 and so on gives me the opportunity to use commands that never list the "not present" ports all the time.&lt;BR /&gt;
&lt;BR /&gt;
/Fredrik</description>
      <pubDate>Fri, 16 Aug 2019 22:52:09 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63115#M17995</guid>
      <dc:creator>FredrikB</dc:creator>
      <dc:date>2019-08-16T22:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in "alias" definition in exshrc.xsf</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63116#M17996</link>
      <description>That answer makes sense to me. Glad the team was able to point you in the right direction.&lt;BR /&gt;
Thanks for coming back to post the update!</description>
      <pubDate>Fri, 16 Aug 2019 23:47:29 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/using-variables-in-quot-alias-quot-definition-in-exshrc-xsf/m-p/63116#M17996</guid>
      <dc:creator>Drew_C</dc:creator>
      <dc:date>2019-08-16T23:47:29Z</dc:date>
    </item>
  </channel>
</rss>

