<?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: Expect script problems in Hybrid Cloud</title>
    <link>https://community.cisco.com/t5/hybrid-cloud/expect-script-problems/m-p/4189623#M26</link>
    <description>&lt;P&gt;There is 2 option you can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can configure VTY Lines to discussonect automatically if they are idle 5min, so you do not required this script&lt;/P&gt;
&lt;P style="margin: 12px 0px; line-height: 19px; color: #000000; font-family: sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;EM&gt;line vty 0 4&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;exec-timeout 5 0&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other option is you need to store the output of VTY lines and disconnect&amp;nbsp; only meet the requirement, Line by Line, more Lines of code required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 vty 1 cisco idle 5w1d 192.168.11.4&lt;BR /&gt;* 3 vty 2 cisco idle 00:00:18 192.168.11.14&lt;BR /&gt;5 vty 4 cisco idle 00:00:09 192.168.11.15&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 10:43:39 GMT</pubDate>
    <dc:creator>balaji.bandi</dc:creator>
    <dc:date>2020-11-27T10:43:39Z</dc:date>
    <item>
      <title>Expect script problems</title>
      <link>https://community.cisco.com/t5/hybrid-cloud/expect-script-problems/m-p/4189528#M25</link>
      <description>&lt;P&gt;I am new to expect and I was using logic to automate disconnecting telnet session where the user is logged in and leave other lines as it is:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; {set i &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;} {$i ==&lt;SPAN class="hljs-number"&gt;4&lt;/SPAN&gt;} {incr i} {  
&lt;SPAN class="hljs-keyword"&gt;send&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"clear line vty $i\r"&lt;/SPAN&gt;  
&lt;SPAN class="hljs-string"&gt;"confirm]"&lt;/SPAN&gt; {&lt;SPAN class="hljs-keyword"&gt;send&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"\r"&lt;/SPAN&gt;}  
&lt;SPAN class="hljs-string"&gt;"% Not allowed"&lt;/SPAN&gt; {&lt;SPAN class="hljs-keyword"&gt;send&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"quit\r"&lt;/SPAN&gt;; &lt;SPAN class="hljs-keyword"&gt;exit&lt;/SPAN&gt;}  
}&lt;/PRE&gt;&lt;P&gt;it disconnects all the lines&lt;/P&gt;&lt;P&gt;now I use the "show user" command but it's hard for me to write a script around it, the output is not friendly enough for me.so I wrote IF statements in this for loop but it was not good and not even deserving to include here. please can somebody guide me in order to how to match strings in an output result and on the basis of the strings decide to clear line or not&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 06:19:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/hybrid-cloud/expect-script-problems/m-p/4189528#M25</guid>
      <dc:creator>DunnLindsey06017</dc:creator>
      <dc:date>2020-11-27T06:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Expect script problems</title>
      <link>https://community.cisco.com/t5/hybrid-cloud/expect-script-problems/m-p/4189623#M26</link>
      <description>&lt;P&gt;There is 2 option you can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can configure VTY Lines to discussonect automatically if they are idle 5min, so you do not required this script&lt;/P&gt;
&lt;P style="margin: 12px 0px; line-height: 19px; color: #000000; font-family: sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;EM&gt;line vty 0 4&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;exec-timeout 5 0&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other option is you need to store the output of VTY lines and disconnect&amp;nbsp; only meet the requirement, Line by Line, more Lines of code required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 vty 1 cisco idle 5w1d 192.168.11.4&lt;BR /&gt;* 3 vty 2 cisco idle 00:00:18 192.168.11.14&lt;BR /&gt;5 vty 4 cisco idle 00:00:09 192.168.11.15&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 10:43:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/hybrid-cloud/expect-script-problems/m-p/4189623#M26</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2020-11-27T10:43:39Z</dc:date>
    </item>
  </channel>
</rss>

