Hey,
Isn’t the problem with this part:
err := command.Run()
if err != nil {
fmt.Fprintln(errors, cmd+": command not found")
}
?
You get the
cat: nonexistent: No such file or directory
from the cat command itselt but the command returns an error so you handle it by displaying
cat: command not found
if you were to just ignore the err you would probably get the correct output