def cmd(options) # :yield: recvdata
      match    = @options["Prompt"]
      time_out = @options["Timeout"]
      fail_eof = @options["FailEOF"]

      if options.kind_of?(Hash)
        string   = options["String"]
        match    = options["Match"]   if options.has_key?("Match")
        time_out = options["Timeout"] if options.has_key?("Timeout")
        fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
      else
        string = options
      end

      self.puts(string)
      if block_given?
        waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c }
      else
        waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof})
      end
    end
def cmd(options) # :yield: recvdata
      match    = @options["Prompt"]
      time_out = @options["Timeout"]
      fail_eof = @options["FailEOF"]

      if options.kind_of?(Hash)
        string   = options["String"]
        match    = options["Match"]   if options.has_key?("Match")
        time_out = options["Timeout"] if options.has_key?("Timeout")
        fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
      else
        string = options
      end

      self.puts(string)
      if block_given?
        waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c }
      else
        waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof})
      end
    end
Send a command to the host.

 More exactly, sends a string to the host, and reads in all received
 data until is sees the prompt or other matched sequence.

 If a block is given, the received data will be yielded to it as
 it is read in.  Whether a block is given or not, the received data
 will be return as a string.  Note that the received data includes
 the prompt and in most cases the host's echo of our command.

 +options+ is either a String, specified the string or command to
 send to the host; or it is a hash of options.  If a hash, the
 following options can be specified:

 String:: the command or other string to send to the host.
 Match:: a regular expression, the sequence to look for in
         the received data before returning.  If not specified,
         the Prompt option value specified when this instance
         was created will be used, or, failing that, the default
         prompt of /[$%#>] \z/n.
 Timeout:: the seconds to wait for data from the host before raising
           a Timeout error.  If not specified, the Timeout option
           value specified when this instance was created will be
           used, or, failing that, the default value of 10 seconds.

 The command or other string will have the newline sequence appended
 to it.