```go
package main
import (
"os/exec"
)
func main() {
cmd := exec.Command("cmd", "/c","pause")
cmd.Start()
}
```
把GO标准包都过3遍吧 :bowtie:
```
package main
import (
"os/exec"
"log"
"fmt"
)
func main() {
cmd := exec.Command("ls")
out, err := cmd.Output()
if err != nil {
log.Fatal(err)
}
fmt.Println(string(out))
}
```
#5
更多评论
这个可以执行:
```go
package main
import (
"os/exec"
"os"
)
func main() {
cmd := exec.Command("ping", "127.0.0.1")
cmd.Stdout= os.Stdout
cmd.Run()
}
```
#1