What you are really wanting there is to run xsel --clipboard and pipe data into it. Talk to your cmd.Stdin! This is mostly straight from the StdinPipe example in the go docs:
cmd := exec.Command ("xsel","--clipboard" ) stdin, err := cmd.StdinPipe() if err != nil { log.Fatal(err) } go func() { defer stdin.Close() io.WriteString(stdin, "values written to stdin are passed to cmd's standard input and in this case end up on the X clipboard") }() out, err := cmd.CombinedOutput() if err != nil { log.Fatal(err) } -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/07f0c9dc-b68b-4868-b88d-7f3cd4aff21a%40googlegroups.com.