I am writing a small program with an interpreter, I would like to transfer any command that is not recognized by my shell to bash and print the output as if it were written in a regular terminal.
func RunExtern(c *shell.Cmd) (string, os.Error) { cmd := exec.Command(c.Cmd(), c.Args()...) out, err := cmd.Output() return string(out), err }
this is what I wrote so far, but it only runs the program with its arguments, I would like to send a whole line to bash and get the output, any idea how to do this?
source share