From 04029988b17bdd76dddde9392b2889926013bb8b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 4 Jun 2019 20:20:15 -0700 Subject: capture the output for Run() Signed-off-by: Jeff Carr --- example2/Makefile | 3 +++ example2/main.go | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 example2/Makefile create mode 100644 example2/main.go (limited to 'example2') diff --git a/example2/Makefile b/example2/Makefile new file mode 100644 index 0000000..250e900 --- /dev/null +++ b/example2/Makefile @@ -0,0 +1,3 @@ +all: + go build + ./example2 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) +} -- cgit v1.2.3