go使用exec.Command执行带管道的命令

2019年9月12日

|

gojuukaze

|

评论:3

|

阅读:2972

|

在go中我们想执行带管道的命令时(如:ps aux|grep go),不能直接像下面这样:
exec.Command("ps", "aux", "|", "grep", "go")
...