cmptest/_osexec

This commit is contained in:
xushiwei
2024-07-19 23:20:55 +08:00
parent 6f82b36962
commit 12b6abe6a3

18
_cmptest/_osexec/exec.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"os"
"os/exec"
"runtime"
)
func main() {
ls := "ls"
if runtime.GOOS == "windows" {
ls = "dir"
}
cmd := exec.Command(ls)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
}