package exec
import "github.com/shuLhan/share/lib/os/exec"
Package exec wrap the standar package "os/exec" to simplify calling Run with stdout and stderr.
Index ¶
- func ParseCommandArgs(in string) (cmd string, args []string)
- func Run(command string, stdout, stderr io.Writer) (err error)
Functions ¶
func ParseCommandArgs ¶
ParseCommandArgs parse the input string into command and arguments. This function detect single, double, or back quote on arguments; and escaped spaces using backslash.
func Run ¶
Run the command and arguments in the string cmd. If stdout or stderr is nil, it will default to os.Stdout and/or os.Stderr.
Source Files ¶
- Version
- v0.53.1 (latest)
- Published
- Mar 2, 2024
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 5 days ago –
Tools for package owners.