You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zk/util/exec/exec_unix.go

18 lines
302 B
Go

// +build !windows
package exec
import (
"os"
"os/exec"
)
// CommandFromString returns a Cmd running the given command with $SHELL.
func CommandFromString(command string) *exec.Cmd {
shell := os.Getenv("SHELL")
if len(shell) == 0 {
shell = "sh"
}
return exec.Command(shell, "-c", command)
}