See command output on terminal
I'm running a command via ssh that I really have to see the output. Is it possible to log it to the console, maybe through an data event?
Yes, do it by data event
Hi, Have you some example to show output of command/s ?
gulp.task('sftp-read', function () {
return gulpSSH.sftp('read', 'pm2.json')
.on('data', function (file) { console.log(file.contents.toString()) })
.pipe(gulp.dest(''));
});
Thanks!
I have a gulp task in a server that executes a watch and all that, cool, but i can't see the log output of it, it never returns the shell logs until the command executed exits, which never happens in a watch command, and to exit the watch i have to exit the shell locally thus not getting any data events.
Is there a way to log the server ssh logs in a 1:1 way? not waiting for the exit of the executed command?