代码示例:
command := exec.Command("ls ~ | grep .zip")
报错:
exec: "pidof tor | xargs kill -HUP": executable file not found in $PATH
解决:
// 添加额外参数 bash -c
command := exec.Command("bash","-c","ls ~ | grep .zip")
// 或
command := exec.Command("sh","-c","ls ~ | grep .zip")