Ian Purton Home

Ruby ssh example with error handling

12 September 09

The following ruby snippet takes an array of commands as a parameter then runs all those commands via SSH.

You get back either a string containing an error or a hash that contains the results for each command, where the command is the key.