| Class | Net::SSH::Service::Shell::Driver |
| In: |
lib/net/ssh/service/shell/driver.rb
|
| Parent: | Object |
The service driver for the Shell service. It manages the creation of new Shell::Shell and Shell::SyncShell subservices.
Usage:
Net::SSH.start( host ) do |session|
shell = session.shell.open
shell.cd "/home/foo"
shell.mkdir "-p some/long/dir"
shell.cd "some/long/dir"
shell.touch "foo.txt"
shell.exit
session.loop
end
Or:
Net::SSH.start( host ) do |session|
shell = session.shell.sync
shell.cd "/home/foo"
out = shell.test "-e some/file.txt"
if out.status == 0
out = shell.cat "some/file.txt"
puts out.stdout
else
puts "no such file 'some/file.txt'"
end
end