title: Why is this expect shell script to ssh into and reboot cisco appliances failing?
body: <p>Created this simple script to perform a reboot on a Cisco (Telepresence) CTS1300, 1000 and 3000 codecs.  The goal is to restart a bunch of these units weekly through the use of a cron. I am using Cygwin, and here's the expect script:</p>
  
  <pre><code>#!/usr/bin/expect -f
  spawn ssh AdminUser@123.123.123.123
  expect "*?assword:*"
  send -- "MyPassword\r"
  expect "*admin:*"
  "send -- "utils system restart\r"
  expect -exact "Are you sure you want to perform a System Restart ?\r
  Enter \"yes\" to Restart the System or any other key to abort\r
  continue: "
  send -- "yes\r"
  expect "*admin:*"
  send -- "quit\r"
  expect eof
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>superuser@SUPERPC ~/ctspsswd 
  ./restartall2
  spawn ssh AdminUser@123.123.123.123
  AdminUser@123.123.123.123's password:
  Command Line Interface is starting up, please wait ...
  
  Welcome to the TelePresence Command Line Interface (version 1.1)
  admin:utils system restart
  Are you sure you want to perform a System Restart ?
  Enter "yes" to Restart the System or any other key to abort
  continue: s
  The System Restart has been aborted
  admin:quit
  Connection to 123.123.123.123 closed.
  </code></pre>
  
  <p>For some weird reason, it only sends "s", which aborts the system restart.</p>
  
  <p>I tried using <code>#!/bin/bash</code> type scripting and output is similar.</p>
  
  <p>I tried using wild chars for expect <code>"*continue:*"</code> and still similar output.</p>
  
  <p>I tried using <code>autoexpect</code> and same exact thing happens. Autoexpect script looks very similar to my script, only is more specific to each character I typed. </p>
  
  <p>I tried sending <code>yes</code> immediately after sending utils system restart, and the result was simply the equivalent of a <code>\r</code>. </p>
  
  <p>Is there something I'm missing?  Otherwise, I'll create a script that will use interact for the <code>yes</code> portion.</p>