<?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: EOS Scripting Issue - (TCL) in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/eos-scripting-issue-tcl/m-p/56466#M16518</link>
    <description>All fixed.&lt;BR /&gt;
&lt;BR /&gt;
For anyone interested I used the following to convert spaces to underscores.&lt;BR /&gt;
&lt;BR /&gt;
set var switch_name $tcl(join [split $switch_name_raw " "] "_")&lt;BR /&gt;
&lt;BR /&gt;</description>
    <pubDate>Fri, 09 May 2014 10:04:00 GMT</pubDate>
    <dc:creator>Paul_Barrett</dc:creator>
    <dc:date>2014-05-09T10:04:00Z</dc:date>
    <item>
      <title>EOS Scripting Issue - (TCL)</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/eos-scripting-issue-tcl/m-p/56465#M16517</link>
      <description>I am in the process of writing an XOS script to backup switches on a UPM event and also ad-hoc by executing the xsf file stored on the switches.&lt;BR /&gt;
The below code is what I have issues with so far.&lt;BR /&gt;
&lt;BR /&gt;
# Get config selected filename&lt;BR /&gt;
set var cli.out 0&lt;BR /&gt;
show switch&lt;BR /&gt;
set var sh_sw_output $tcl(split ${cli.out} "\n")&lt;BR /&gt;
set var sh_sw_index $tcl(lindex $sh_sw_output 24)&lt;BR /&gt;
set var config_selected $tcl(string replace $sh_sw_index 0 17 {})&lt;BR /&gt;
#Get switch name&lt;BR /&gt;
set var sh_sw_output $tcl(split ${cli.out} "\n")&lt;BR /&gt;
set var sh_sw_index $tcl(lindex $sh_sw_output 1)&lt;BR /&gt;
set var switch_name_raw $tcl(string replace $sh_sw_index 0 17 {})&lt;BR /&gt;
#Change spaces to underscore&lt;BR /&gt;
set var switch_name $tcl(regsub -all {\W} $switch_name_raw "_" {})&lt;BR /&gt;
show var config_selected&lt;BR /&gt;
show var switch_name&lt;BR /&gt;
&lt;BR /&gt;
Basically when i am trying to replace spaces with underscores with "set var switch_name $tcl(regsub -all {\W} $switch_name_raw "_" {})" it is not actually returning the variable with spaces replaced with underscores it is returning the number of times it matched the regex.&lt;BR /&gt;
&lt;BR /&gt;
EG if the switch name was "Test Scripting Switch" the variable switch_name would be "2" not "Test_Scripting_Switch"&lt;BR /&gt;
&lt;BR /&gt;
Any ideas ?&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 09 May 2014 05:10:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/eos-scripting-issue-tcl/m-p/56465#M16517</guid>
      <dc:creator>Paul_Barrett</dc:creator>
      <dc:date>2014-05-09T05:10:00Z</dc:date>
    </item>
    <item>
      <title>RE: EOS Scripting Issue - (TCL)</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/eos-scripting-issue-tcl/m-p/56466#M16518</link>
      <description>All fixed.&lt;BR /&gt;
&lt;BR /&gt;
For anyone interested I used the following to convert spaces to underscores.&lt;BR /&gt;
&lt;BR /&gt;
set var switch_name $tcl(join [split $switch_name_raw " "] "_")&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 09 May 2014 10:04:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/eos-scripting-issue-tcl/m-p/56466#M16518</guid>
      <dc:creator>Paul_Barrett</dc:creator>
      <dc:date>2014-05-09T10:04:00Z</dc:date>
    </item>
  </channel>
</rss>

