ommand := "echo hello”
cmd := exec.Command("/bin/bash", "-c", command)
bytes,err := cmd.Output()
if err != nil {
     log.Println(err)
}
resp := string(bytes)
log.Println(resp)

 

相关文章:

  • 2021-12-27
  • 2022-01-20
  • 2021-09-19
  • 2022-01-18
  • 2021-07-14
  • 2021-08-06
  • 2022-12-23
猜你喜欢
  • 2023-03-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-01-02
  • 2022-01-11
相关资源
相似解决方案