Print the stdout from exec command in real time in Go [duplicate]
问题 This question already has an answer here : How can I redirect the stdout and stderr of a command to both the console and a log file while outputting in real time? (1 answer) Closed last year . I have a small Go tool which basically allows the user to define an command that than will be run using os/exec . My problem is that I want to show the user the output (stdout/stderr) of the command. An example could look like this: The user defines a command that in the end is sh test.sh . Content of