banner
Eget

Eget

域名里的erection泛指建筑物之类

golang在Linux下执行命令

写一遍就够了,下次 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)
	}
}
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.