Skip to content

Instantly share code, notes, and snippets.

@savaki
Created May 6, 2014 00:15
Show Gist options
  • Save savaki/00ff85082e0f19d7ce39 to your computer and use it in GitHub Desktop.
Save savaki/00ff85082e0f19d7ce39 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os/exec"
)
func main() {
// in this example, the offending docker code has been placed in a shell script
command := fmt.Sprintf("/bin/bash sample.sh")
fmt.Println(command)
data, err := exec.Command("/bin/bash", "-c", command).CombinedOutput()
if err != nil {
panic(err)
}
fmt.Println(string(data))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment