From 954470c34ce2296c4d534c261f400c4fa9f20900 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 10 May 2019 01:54:36 +0000 Subject: correct stdin handling. stderr might still be broken Signed-off-by: Jeff Carr --- example1/Makefile | 3 +++ example1/example1 | Bin 0 -> 3187896 bytes example1/main.go | 27 +++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 example1/Makefile create mode 100755 example1/example1 create mode 100644 example1/main.go (limited to 'example1') diff --git a/example1/Makefile b/example1/Makefile new file mode 100644 index 0000000..9fc318d --- /dev/null +++ b/example1/Makefile @@ -0,0 +1,3 @@ +all: + go build + ./example1 diff --git a/example1/example1 b/example1/example1 new file mode 100755 index 0000000..625385e Binary files /dev/null and b/example1/example1 differ diff --git a/example1/main.go b/example1/main.go new file mode 100644 index 0000000..4a36503 --- /dev/null +++ b/example1/main.go @@ -0,0 +1,27 @@ +package main + +/* +import "log" +import "reflect" +import "os" +*/ + +// import "github.com/davecgh/go-spew/spew" + +import "git.wit.com/jcarr/shell" + +func main() { + shell.SpewOn() + + shell.Run("ls /tmp") + + shell.Run("ping -c 4 localhost") + + // slow down the polling to every 2 seconds + shell.SetDelayInMsec(2000) + shell.Run("ping -c 4 localhost") + + // TODO: this might not be working + // check error handling + shell.Run("ls /tmpthisisnothere") +} -- cgit v1.2.3