[go-nuts] Re: Write a program for Linux in Go lang which can run any command (of coder's choice) on another machine (privately or publicly accessible) and prints its output.

2017-04-12 Thread Rich
Let me get you pointed in the right direction. I do this ALL the time. 
First it to learn the Godoc site. Godoc is an awesome site that you can 
search for different community written extensions to go, as well as get 
documentation on the existing go language packages -- if you're going to 
write in go, godoc.org is your best friend. https://www.godoc.org. once 
there search for a tool called 'gexpect' by ThomasRooney.  This will allow 
you to control an ssh session by any user to any system that user has 
access to.  Another way is to use the built in os/exec: cmd := exec.Command(
"/usr/bin/ssh", "-oStrictHostKeyChecking=no", cHost, cHostCmd)

 To get the user's input use fmt.Scanln.  

fmt.Printf("Remote Host: ")
cHost:=fmt.Scanln("\n")
fmt.Printf("Command: ")
cHostCmd:= fmt.Scanln("\n")

On Monday, April 10, 2017 at 6:42:32 PM UTC-4, Owais Hashmi wrote:
>
> Write a program for Linux in Go lang which can run any command (of coder's 
> choice) on another machine (privately or publicly accessible) and prints 
> its output.
>

-- 
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.


[go-nuts] Re: Write a program for Linux in Go lang which can run any command (of coder's choice) on another machine (privately or publicly accessible) and prints its output.

2017-04-11 Thread paraiso . marc
sounds like homework that should be done by the student, not the community. 

Le mardi 11 avril 2017 00:42:32 UTC+2, Owais Hashmi a écrit :
>
> Write a program for Linux in Go lang which can run any command (of coder's 
> choice) on another machine (privately or publicly accessible) and prints 
> its output.
>

-- 
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.