don't you want to pass back the trimmed stdout?

Also, I think `stdout.trim()` would be a more economical way of doing the same thing? Does it handle newlines?