I am trying to run a shell command, capture stdout and write that output to a file. However, I seem to be missing a few steps, as the file I am trying to write is empty when
You can also use:
cmd.Stdout = os.Stdout
which will redirect all cmd output to the OS' standard output.