I am trying to run the system commands in golang. I want the stdout to be printint directly out onto the screen. In golang I use the following now :
out, err := exec.Command(cmd).Output()
if err != nil {
fmt.Println("error occured")
fmt.Printf("%s", err)
}
Here I am storing the output into "out" variable and then printing that onto the screen. But I want something which prints as a normal shell command like the system() command in perl.
in perl:
system("ls -l");
We don't need to store anything here.
is there some command in golang which mimics exactly the system() cmd in perl.