diff options
| author | Jeff Carr <[email protected]> | 2019-06-04 20:20:15 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-04 20:20:15 -0700 |
| commit | 04029988b17bdd76dddde9392b2889926013bb8b (patch) | |
| tree | 779d4a07a35a8b6df9280eab5ac82ecd78156c55 /example2/main.go | |
| parent | 7e68be74193735678b1ac6e1bb51c0efa8bbda9c (diff) | |
capture the output for Run()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'example2/main.go')
| -rw-r--r-- | example2/main.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/example2/main.go b/example2/main.go new file mode 100644 index 0000000..d8f39b4 --- /dev/null +++ b/example2/main.go @@ -0,0 +1,11 @@ +package main + +import "log" +import "fmt" +import "git.wit.com/wit/shell" + +func main() { + tmp, output, err := shell.Run("cat /etc/issue") + log.Println("cat /etc/issue returned", tmp, "error =", err) + fmt.Print(output) +} |
