github.com/StackPointCloud/packer@v0.10.2-0.20180716202532-b28098e0f79b/builder/lxc/command.go (about) 1 package lxc 2 3 import ( 4 "os/exec" 5 ) 6 7 // CommandWrapper is a type that given a command, will possibly modify that 8 // command in-flight. This might return an error. 9 type CommandWrapper func(string) (string, error) 10 11 // ShellCommand takes a command string and returns an *exec.Cmd to execute 12 // it within the context of a shell (/bin/sh). 13 func ShellCommand(command string) *exec.Cmd { 14 return exec.Command("/bin/sh", "-c", command) 15 }