When you use a system call in a Ruby script, you can get the output of this command as follows:
output = `ls`
puts output
This is what this question was about.
But is there a way to show the output of a continuous system call? For example, if you run this secure copy command to retrieve a file from the server via SSH:
scp user@someserver:remoteFile /some/local/folder/
... it shows a continuous exit with loading progress. But this:
output = `scp user@someserver:remoteFile /some/local/folder/`
puts output
... does not record this conclusion.
How to show the current download progress from my Ruby script?
source
share