HNHacker News
TopNewBestAskShowJobs

noasiwiwiwu

2 karma · joined August 20, 2017

submissionscomments
noasiwiwiwu··on Show HN: A Go package to execute shell commands in specified order
Hi

Your software is broken by assuming a command can be split up into arguments by spaces, and also not letting the os package properly escape your arguments.

https://github.com/amalfra/oexec/blob/master/oexec.go#L48

Here's a command that would be impossible to execute with your software, notice how the last argument is a single argument:

    c := exec.Command(
        "/usr/bin/osascript",
        "-e",
        "say 5")
    output, err := c.CombinedOutput()