In my shell, I can exec command acme.sh --issue --dns -d exmaple.com --yes-I-know-dns-manual-mode-enough-go-ahead-please
and get output.
now I want to do that in go, and my code like:
cmd := exec.Command("bash", "-c", "acme.sh --issue --dns -d exmaple.com --yes-I-know-dns-manual-mode-enough-go-ahead-please");
out, err := cmd.CombinedOutput()
if err != nil {
log.Fatalf("issue failed with error: %s
", err)
}
fmt.Printf("combined out:
%s
", string(out))
but I got error exit status 1
.
and as the comment said, I separate argument:
exec.Command("bash", "-c", "acme.sh", "--issue", "--dns", "-d exmaple.com", "--yes-I-know-dns-manual-mode-enough-go-ahead-please");
but the result is that it exec acme.sh
without parameters.