From 621be7d20aeb1612ed40989e85eae4933f7dec1f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 14 Jun 2019 10:02:52 -0700 Subject: [PATCH] updates to Exec() Signed-off-by: Jeff Carr --- shell.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shell.go b/shell.go index 5f947a6..fbbbcc1 100644 --- a/shell.go +++ b/shell.go @@ -255,10 +255,13 @@ func nonBlockingReader(buffReader *bufio.Reader, writeFileHandle *os.File, stdou func Exec(cmdline string) { log.Println("shell.Run() START " + cmdline) - cmd := Chomp(cmdline) // this is like 'chomp' in perl - cmdArgs := strings.Fields(cmd) + cmd := Chomp(cmdline) // this is like 'chomp' in perl + cmdArgs := strings.Fields(cmd) - process := exec.Command(cmdArgs[0], cmdArgs[1:len(cmdArgs)]...) + process := exec.Command(cmdArgs[0], cmdArgs[1:len(cmdArgs)]...) + process.Stderr = os.Stderr + process.Stdin = os.Stdin + process.Stdout = os.Stdout process.Start() err := process.Wait() log.Println("shell.Exec() err =", err)