I was using ssh with the exec package.  However, I didn't know how to 
capture the output of the cmd run.  Today, I studied the exec package and 
found the Output functionality.  Now I can capture the output.  

https://golang.org/pkg/os/exec/?m=all#Cmd.Output

Best,

Hemant

On Tuesday, September 25, 2018 at 11:29:08 PM UTC-4, Robert Engels wrote:
>
> You can do this via ssh.
>
> On Sep 25, 2018, at 7:01 PM, Hemant Singh <heman...@gmail.com 
> <javascript:>> wrote:
>
> I have been able to run a command on a remote machine using Go.  Is there 
> a working example that shows how to capture the output of the command back 
> to the client machine?  Maybe an interactive shell...   
>
> My other choice is to run the command and save its output to a file and 
> copy the file from the remote machine.
>
> Thanks,
>
> Hemant
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to