<?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: TCL Script to read from line and input in another line in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49664#M13202</link>
    <description>Hello Ahmed,&lt;BR /&gt;
&lt;BR /&gt;
The following script returns ports list as an variable &lt;BR /&gt;
enable cli scripting  disable clipaging  set var cli.out 0  sh conf "netlogin" | i enable   set var ss $TCL(split ${cli.out} "\n")  set var sline $TCL(lsearch -glob $ss *ports*dot1x*)  set var sline $TCL(lindex $ss $sline)  set var sline $TCL(regexp -all -inline {\S+} $sline)  set var result $TCL(lindex $sline 3)  show var result&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
* Slot-1 Stack.38 # set var cli.out 0&lt;BR /&gt;
  * Slot-1 Stack.39 # sh conf "netlogin" | i enable &lt;BR /&gt;
 ss $TCL(split ${cli.out} "\n")&lt;BR /&gt;
set var sline $TCL(lsearch -glob $ss *ports*dot1x*)&lt;BR /&gt;
set var sline $TCL(lindex $ss $sline)&lt;BR /&gt;
set var sline $TCL(regexp -all -inline {\S+} $sline)&lt;BR /&gt;
set var result $TCL(lindex $sline 3)&lt;BR /&gt;
show var resultenable netlogin dot1x mac web-based&lt;BR /&gt;
enable netlogin ports &lt;U&gt;&lt;B&gt;1:10-20,2:30,2:35-44&lt;/B&gt;&lt;/U&gt; dot1x &lt;BR /&gt;
enable netlogin ports 2:1-10 mac &lt;BR /&gt;
* Slot-1 Stack.40 # set var ss $TCL(split ${cli.out} "\n")&lt;BR /&gt;
* Slot-1 Stack.41 # set var sline $TCL(lsearch -glob $ss *ports*dot1x*)&lt;BR /&gt;
* Slot-1 Stack.42 # set var sline $TCL(lindex $ss $sline)&lt;BR /&gt;
* Slot-1 Stack.43 # set var sline $TCL(regexp -all -inline {\S+} $sline)&lt;BR /&gt;
* Slot-1 Stack.44 # set var result $TCL(lindex $sline 3)&lt;BR /&gt;
* Slot-1 Stack.45 # show var result&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;1:10-20,2:30,2:35-44 &lt;/U&gt;&lt;/B&gt;       &lt;BR /&gt;
* Slot-1 Stack.46 # &lt;BR /&gt;
* Slot-1 Stack.46 #                                   &lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Nikolay&lt;BR /&gt;
&lt;BR /&gt;</description>
    <pubDate>Wed, 15 Nov 2017 19:16:00 GMT</pubDate>
    <dc:creator>Necheporenko__N</dc:creator>
    <dc:date>2017-11-15T19:16:00Z</dc:date>
    <item>
      <title>TCL Script to read from line and input in another line</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49663#M13201</link>
      <description>what i am trying to automate is simple, but i have little knowledge about TCL.&lt;BR /&gt;
&lt;BR /&gt;
1-  issue the following command:&lt;BR /&gt;
&lt;BR /&gt;
show configuration netlogin.&lt;BR /&gt;
&lt;BR /&gt;
2- match the underlined part from the below output of the previous command:&lt;BR /&gt;
&lt;BR /&gt;
* Slot-1  # sh conf "netlogin"&lt;BR /&gt;
#&lt;BR /&gt;
# Module netLogin configuration.&lt;BR /&gt;
#&lt;BR /&gt;
configure netlogin vlan temp&lt;BR /&gt;
enable netlogin dot1x mac web-based&lt;BR /&gt;
configure netlogin authentication protocol-order dot1x mac web-based&lt;BR /&gt;
configure netlogin add mac-list ff:ff:ff:ff:ff:ff 48&lt;BR /&gt;
enable netlogin ports &lt;U&gt;&lt;B&gt;1:1-15,1:17-18,1:20-38,1:43-45,2:3-24,2:28,2:30,2:36-38,2:43-45&lt;/B&gt;&lt;/U&gt; dot1x&lt;BR /&gt;
enable netlogin ports 1:16,1:35-40,1:43-45,2:35-38,2:40,2:43-45 mac&lt;BR /&gt;
configure netlogin dot1x ports 1:1 timers server-timeout 3 reauth-period 0 reauthentication off&lt;BR /&gt;
configure netlogin dot1x ports 1:2 timers server-timeout 3 reauth-period 0 reauthentication off&lt;BR /&gt;
&lt;BR /&gt;
3- input the above in the below command &lt;BR /&gt;
&lt;BR /&gt;
configure upm event user-authenticate profile printer ports&lt;U&gt;&lt;B&gt; **HERE**&lt;BR /&gt;
&lt;/B&gt;&lt;/U&gt;&lt;BR /&gt;
4- save.&lt;BR /&gt;
&lt;BR /&gt;
please notice that i want to match only dot1x ports, not the mac.&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance.</description>
      <pubDate>Tue, 07 Nov 2017 19:36:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49663#M13201</guid>
      <dc:creator>Ahmed_Haroun</dc:creator>
      <dc:date>2017-11-07T19:36:00Z</dc:date>
    </item>
    <item>
      <title>RE: TCL Script to read from line and input in another line</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49664#M13202</link>
      <description>Hello Ahmed,&lt;BR /&gt;
&lt;BR /&gt;
The following script returns ports list as an variable &lt;BR /&gt;
enable cli scripting  disable clipaging  set var cli.out 0  sh conf "netlogin" | i enable   set var ss $TCL(split ${cli.out} "\n")  set var sline $TCL(lsearch -glob $ss *ports*dot1x*)  set var sline $TCL(lindex $ss $sline)  set var sline $TCL(regexp -all -inline {\S+} $sline)  set var result $TCL(lindex $sline 3)  show var result&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
* Slot-1 Stack.38 # set var cli.out 0&lt;BR /&gt;
  * Slot-1 Stack.39 # sh conf "netlogin" | i enable &lt;BR /&gt;
 ss $TCL(split ${cli.out} "\n")&lt;BR /&gt;
set var sline $TCL(lsearch -glob $ss *ports*dot1x*)&lt;BR /&gt;
set var sline $TCL(lindex $ss $sline)&lt;BR /&gt;
set var sline $TCL(regexp -all -inline {\S+} $sline)&lt;BR /&gt;
set var result $TCL(lindex $sline 3)&lt;BR /&gt;
show var resultenable netlogin dot1x mac web-based&lt;BR /&gt;
enable netlogin ports &lt;U&gt;&lt;B&gt;1:10-20,2:30,2:35-44&lt;/B&gt;&lt;/U&gt; dot1x &lt;BR /&gt;
enable netlogin ports 2:1-10 mac &lt;BR /&gt;
* Slot-1 Stack.40 # set var ss $TCL(split ${cli.out} "\n")&lt;BR /&gt;
* Slot-1 Stack.41 # set var sline $TCL(lsearch -glob $ss *ports*dot1x*)&lt;BR /&gt;
* Slot-1 Stack.42 # set var sline $TCL(lindex $ss $sline)&lt;BR /&gt;
* Slot-1 Stack.43 # set var sline $TCL(regexp -all -inline {\S+} $sline)&lt;BR /&gt;
* Slot-1 Stack.44 # set var result $TCL(lindex $sline 3)&lt;BR /&gt;
* Slot-1 Stack.45 # show var result&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;1:10-20,2:30,2:35-44 &lt;/U&gt;&lt;/B&gt;       &lt;BR /&gt;
* Slot-1 Stack.46 # &lt;BR /&gt;
* Slot-1 Stack.46 #                                   &lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Nikolay&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Nov 2017 19:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49664#M13202</guid>
      <dc:creator>Necheporenko__N</dc:creator>
      <dc:date>2017-11-15T19:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: TCL Script to read from line and input in another line</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49665#M13203</link>
      <description>Thanks Nikolay , That is great.</description>
      <pubDate>Wed, 22 Nov 2017 18:59:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/tcl-script-to-read-from-line-and-input-in-another-line/m-p/49665#M13203</guid>
      <dc:creator>Ahmed_Haroun</dc:creator>
      <dc:date>2017-11-22T18:59:00Z</dc:date>
    </item>
  </channel>
</rss>

