in one of my R functions use system2 to run a command to a remote server using ssh:
system2("ssh",c("-C","luca@remote.server","shQuote("\"remote_command\"")),
stdout="output.txt", stderr="")
If I run this from a Linux machine, the standard error (used to display warnings) is correctly shown while the command is being executed.
However, in Windows, the standard error is not displayed (though the command is executed correctly and output.txt is as expected).
How can I fix this and have the standard error displayed both on Windows and Linux?
I was thinking to use the wait = FALSE option, redirecting stderr to a temporary file, and having it displayed while it is being written (like tail -F does in Linux), but I didn't manage to make it work.
Any other solution is welcome!
Aucun commentaire:
Enregistrer un commentaire