package main import ( "os/exec" ) // exec command func doCommand(cmd string) { _ = exec.Command("sh", "-c", cmd).Run() } func main() { doCommand("libreoffice --headless --convert-to html *.doc --outdir output") doCommand("libreoffice --headless --convert-to html *.docx --outdir output") }