Reputation: 435
I created a session and can execute the ls command
library(ssh)
session<-ssh_connect("[email protected]", keyfile = "my private key")
ssh_exec_wait(session, command = 'ls /home/')
This results of the ls command displayed in rstudio console and the function returns 0.
So this does not work
varFileList<-ssh_exec_wait(session, command = 'ls /home/')
How do I accomplish this?
Upvotes: 2
Views: 486
Reputation: 435
Found the answer
varFileList<-capture.output(ssh_exec_wait(session, command = 'ls /home/'))
Upvotes: 2