I have the following script:
#!/usr/bin/env ruby require \'rubygems\' require \'net/ssh\' Net::SSH.start(\'host1\', \'root\', :password => \"mypassword1\
You can just give different commands separated by a new line. Something like:
@result = ssh.exec!("cd /var/example/engines/ pwd ") puts @result
Its probably easier (and clearer) to pass the command to a variable, then pass the variable into exec. Same principle though.
exec