Skip to content

Instantly share code, notes, and snippets.

@liuggio
Last active November 9, 2016 02:24
Show Gist options
  • Save liuggio/114f506fbe040ac93687dc797b923cbf to your computer and use it in GitHub Desktop.
Save liuggio/114f506fbe040ac93687dc797b923cbf to your computer and use it in GitHub Desktop.
// go build . // sudo ./c /bin/sh -c "hostname bo;hostname"
package main
import (
"fmt"
"os"
"os/exec"
// "syscall"
)
func main() {
cmd := exec.Command(os.Args[1], os.Args[2:] ...)
// cmd.SysProcAttr = &syscall.SysProcAttr{
// Cloneflags: syscall.CLONE_NEWUTS,
// }
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Printf("Errrrrrror", err)
os.Exit(1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment