Replace The Current Process With An External Command
package main
import "fmt"
import "os"
import "syscall"
func main() {
// get the system's environment variables
environment := os.Environ()
// get a slice of the pieces of the command
command := []string{"tmux", "new-session", "-s", "burrito"}
err := syscall.Exec("/usr/local/bin/tmux", command, environment)
if err != nil {
fmt.Printf("%v", err)
}
}Last updated