寫一遍就夠了,下次 CV
var (
output []byte
err error
)
func ExecBash(order string) string {
cmd := exec.Command("/bin/bash", "-c", order)
if output, err = cmd.Output(); err != nil {
log.Println(err)
return err.Error()
} else {
return string(output)
}
}