updates to Exec()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-14 10:02:52 -07:00
parent 60671c1308
commit 621be7d20a
1 changed files with 6 additions and 3 deletions

View File

@ -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)