Yes, this is better. Thanks func main() { cmd := exec.Command("dmtxwrite", "-s", "16x48", "-o", "image2.png") cmd.Stdin = strings.NewReader("123456") if err := cmd.Run(); err != nil { panic(err.Error()) } }
Il giorno lunedì 22 giugno 2020 18:19:36 UTC+2, Bakul Shah ha scritto: > > You can avoid calling the shell by observing that you are simply passing > "123456" as input, which you can do in a Go Program itself. > See https://golang.org/pkg/os/exec/#example_Command > > > On Jun 22, 2020, at 8:54 AM, Franco Marchesini <franco.m...@gmail.com > <javascript:>> wrote: > > Help, > > how I can translate this shell command : > > echo -n 123456 | dmtxwrite -s 16x48 -o image.png > > to golang > > exec.Commad() > > Thanks in advance > Franco > > -- > 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 golan...@googlegroups.com <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/c6aaba94-453b-41dc-83a4-ffd4f3912494o%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/c6aaba94-453b-41dc-83a4-ffd4f3912494o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- 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/2578ddd7-5d86-44f2-80e2-16872553a03ao%40googlegroups.com.