<?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: Minicom Send Return Character in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3715378#M1809</link>
    <description>&lt;P&gt;Try this. - change the variable as per your setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#!/usr/bin/expect -f&lt;BR /&gt; set timeout 20&lt;BR /&gt; set 10.10.10.1&lt;BR /&gt; set Username "username"&lt;BR /&gt; set Password "password"&lt;BR /&gt; set Directory /home/Desktop/logs&lt;BR /&gt; log_file -a /home/debug.log&lt;BR /&gt; spawn ssh -o "StrictHostKeyChecking no" $Username@10.10.10.1&lt;BR /&gt; expect "*assword: "&lt;BR /&gt; send "$Password\r"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "enable conf t\r"&lt;BR /&gt; expect "(config)#"&lt;BR /&gt; send "interface range GigabitEthernet 0/1-8 \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "power inline static \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "no cdp enable \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "end"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "wr mem\r"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "exit\r"&lt;BR /&gt; sleep 1&lt;BR /&gt;exit&lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 23:36:24 GMT</pubDate>
    <dc:creator>balaji.bandi</dc:creator>
    <dc:date>2018-09-28T23:36:24Z</dc:date>
    <item>
      <title>Minicom Send Return Character</title>
      <link>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3714694#M1808</link>
      <description>&lt;P&gt;I would like to send the following commands to a 3560-CX 8-Port Switch:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;enable
interface range GigabitEthernet 0/1-8
power inline static
no cdp enable
exit
exit
copy running-config startup-config&lt;/PRE&gt;
&lt;P&gt;But prior to being able to enter any commands, I must press enter. Can I send a return carriage&amp;nbsp;in a .txt file to pass to a minicom command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried '/r' and "/r" which did not work. I also tried a simple expect script:&lt;/P&gt;
&lt;PRE&gt;#!/usr/bin/expect -f&lt;BR /&gt;send "\r"&lt;/PRE&gt;
&lt;P&gt;Which also did not work.&lt;/P&gt;
&lt;P&gt;The goal is to just call the script like such:&lt;/P&gt;
&lt;PRE&gt;minicom -S testScript.sh #or testScript.txt&lt;/PRE&gt;
&lt;P&gt;Any help is greatly appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 11:27:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3714694#M1808</guid>
      <dc:creator>james.hayek</dc:creator>
      <dc:date>2019-03-01T11:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Minicom Send Return Character</title>
      <link>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3715378#M1809</link>
      <description>&lt;P&gt;Try this. - change the variable as per your setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#!/usr/bin/expect -f&lt;BR /&gt; set timeout 20&lt;BR /&gt; set 10.10.10.1&lt;BR /&gt; set Username "username"&lt;BR /&gt; set Password "password"&lt;BR /&gt; set Directory /home/Desktop/logs&lt;BR /&gt; log_file -a /home/debug.log&lt;BR /&gt; spawn ssh -o "StrictHostKeyChecking no" $Username@10.10.10.1&lt;BR /&gt; expect "*assword: "&lt;BR /&gt; send "$Password\r"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "enable conf t\r"&lt;BR /&gt; expect "(config)#"&lt;BR /&gt; send "interface range GigabitEthernet 0/1-8 \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "power inline static \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "no cdp enable \r"&lt;BR /&gt; expect "(config-if-range)#"&lt;BR /&gt; send "end"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "wr mem\r"&lt;BR /&gt; expect "#"&lt;BR /&gt; send "exit\r"&lt;BR /&gt; sleep 1&lt;BR /&gt;exit&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 23:36:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3715378#M1809</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2018-09-28T23:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Minicom Send Return Character</title>
      <link>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3716916#M1810</link>
      <description>&lt;P&gt;Thank you for your help!!&lt;/P&gt;
&lt;P&gt;I do have a few questions in regard to the code you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will also comment below the error message&amp;nbsp;I received. I placed comments below each line in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#!/usr/bin/expect -f
set timeout 20
set 10.10.10.1
set Username "username"
set Password "password&lt;/PRE&gt;
&lt;P&gt;This will be the username and password to login to my RPi running Kali, correct?&lt;/P&gt;
&lt;PRE&gt;set Directory /home/Desktop/logs
&lt;/PRE&gt;
&lt;P&gt;I do not have this directory. I have changed the directory to:&lt;/P&gt;
&lt;P&gt;/root/Desktop/logs (I made the logs folder using mkdir)&lt;/P&gt;
&lt;PRE&gt;log_file -a /home/debug.log&lt;/PRE&gt;
&lt;P&gt;Does this command create a log file named debug.log?&lt;/P&gt;
&lt;P&gt;I changed the path to: /root/debug.log (there is no .log file in the directory even after I run the script)&lt;/P&gt;
&lt;PRE&gt;spawn ssh -o "StrictHostKeyChecking no" $Username@10.10.10.1
expect "*assword: "
send "$Password\r"
expect "#"&lt;/PRE&gt;
&lt;P&gt;Is there supposed to be a space after the colon?&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;send "enable conf t\r"&lt;/PRE&gt;
&lt;P&gt;It is at this point that I saved the .sh file and called it using minicom. I wanted to see if the switch&amp;gt; prompt would turn to switch# but it did not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually got the error: "script "testScript.sh" line 4: unknown variable "root"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;
&lt;P&gt;Thanks again for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 21:27:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3716916#M1810</guid>
      <dc:creator>james.hayek</dc:creator>
      <dc:date>2018-10-01T21:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Minicom Send Return Character</title>
      <link>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3717765#M1811</link>
      <description>&lt;P&gt;One of post with more details - hope this helps you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.balajibandi.com/2015/10/03/cisco-automate-the-config-with-expect-command/" target="_blank"&gt;http://www.balajibandi.com/2015/10/03/cisco-automate-the-config-with-expect-command/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 20:02:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/minicom-send-return-character/m-p/3717765#M1811</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2018-10-02T20:02:15Z</dc:date>
    </item>
  </channel>
</rss>

