github.phpd.cn/hashicorp/packer@v1.3.2/builder/amazon/chroot/command.go (about) 1 package chroot 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 }