What do you see when you bash -c "lspci | grep -i vga | grep -i nvidia" echo $?
If you have no nvidia line or no vga line in lspci, this will output 1. On Mon, 2020-02-17 at 14:41 -0800, Dean Schulze wrote: > This command always sets the err to "exit status 1" even though it > executes correctly: > > out, err := exec.Command("/bin/bash", "-c", "lspci | grep -i > vga | grep -i nvidia").CombinedOutput() > > I expected it to return 0 when executing successfully. What am I > missing? > -- > 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/fe0058b0-9772-4a8e-8f39-4f85ebab6e4b%40googlegroups.com > . -- 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/541ce5a12038a31888c52476592821af67f848fa.camel%40kortschak.io.