Run runs cmd on the remote host. Typically, the remote server passes cmd to the shell for interpretation. A Session only accepts one call to Run, Start, Shell, Output, or CombinedOutput. The returned error is nil if the command runs, has no problems copying stdin, stdout, and stderr, and exits with
(cmd string)
| 307 | // unsuccessfully or is interrupted by a signal, the error is of type |
| 308 | // *ExitError. Other error types may be returned for I/O problems. |
| 309 | func (s *Session) Run(cmd string) error { |
| 310 | err := s.Start(cmd) |
| 311 | if err != nil { |
| 312 | return err |
| 313 | } |
| 314 | return s.Wait() |
| 315 | } |
| 316 | |
| 317 | // Output runs cmd on the remote host and returns its standard output. |
| 318 | func (s *Session) Output(cmd string) ([]byte, error) { |