gf/.example/os/gproc/gproc_shellexec.go

15 lines
205 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/os/gproc"
)
// 执行shell指令
func main() {
r, err := gproc.ShellExec(`sleep 3s; echo "hello gf!";`)
fmt.Println("result:", r)
fmt.Println(err)
}