It would exec.Command returns the result code of the process not whether it was 
able to be executed. 

> On Feb 17, 2020, at 7:51 PM, Dan Kortschak <d...@kortschak.io> wrote:
> 
> 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.

-- 
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/26C1B31E-4272-49F5-B3C8-F863B24CAA68%40ix.netcom.com.

Reply via email to