ssh

Name

ssh -- Run programs on an ssh pipe.

Synopsis

package require ssh

set output [::ssh::ssh host command]

set fd [::ssh::shipe host command access]

set info [::ssh::sshpid host command ]

DESCRIPTION

The ssh package provides a set of commands that allow you to run an ssh command in a pipeline. For this to work, the remote system must hold a public key that corresponds to your identity's private key. The intent of the package is to make it easy to run programs on remote systems that are participating in an experiment.

All commands are in the ::namespace:: namespace. The publicly visible ones are also on the namespace export list and can be imported into whichever namespace is appropriate.

PUBLIC procedures/commands

set output [::ssh::ssh host command]

Synchronously runs the command in host The output and error of the command are returned separated by a newline character. Note that as with all of these commands it's not possible to tell if the command exited in error or succes..

set fd [::ssh::shipe host command access]

Runs command via ssh on host. The command is run over an ssh pipe. The access. The access parameter is the same as an access parameter for an open.

The pipe is set up so that if it is open for read, both standard error and standard output are captured by the pip. The Read/write access modes allow you to write data or commands to command as well as to read data from it.

set info [::ssh::sshpid host command ]

Same as ssh::sshpipe, however the command returns a three element list. The first element of the list is the PID of the ssh command. The second is the fd of the pipe you can read from to get stdout and stderr from the command. The third element is the fd you can write to to send data/commands to the pipe.

Note that as Tcl is currently implemented, the two pipefds are currently the same. Don't assume that to be the case in the event we change this in the future.