2016-05-19 05:50:38 +00:00
|
|
|
// +build linux
|
|
|
|
|
2015-12-22 15:56:33 +01:00
|
|
|
package lxc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
)
|
|
|
|
|
|
|
|
// CommandWrapper is a type that given a command, will possibly modify that
|
|
|
|
// command in-flight. This might return an error.
|
|
|
|
type CommandWrapper func(string) (string, error)
|
|
|
|
|
|
|
|
// ShellCommand takes a command string and returns an *exec.Cmd to execute
|
|
|
|
// it within the context of a shell (/bin/sh).
|
|
|
|
func ShellCommand(command string) *exec.Cmd {
|
|
|
|
return exec.Command("/bin/sh", "-c", command)
|
|
|
|
}
|