summaryrefslogtreecommitdiff
path: root/example1/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-10 01:54:36 +0000
committerJeff Carr <[email protected]>2019-05-10 01:54:36 +0000
commit954470c34ce2296c4d534c261f400c4fa9f20900 (patch)
tree43cad0b47353183710318906586fa81de35e6fc2 /example1/main.go
parent8a5c9922e408da922fd7889672da0cebcb6700a8 (diff)
correct stdin handling. stderr might still be broken
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'example1/main.go')
-rw-r--r--example1/main.go27
1 files changed, 27 insertions, 0 deletions
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")
+}