Last active
November 9, 2016 02:24
-
-
Save liuggio/114f506fbe040ac93687dc797b923cbf to your computer and use it in GitHub Desktop.
// go build . // sudo ./c /bin/sh -c "hostname bo;hostname"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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