How can I retrieve the output of my command when using rake sh?

Viewed 9072

I am running a command using sh and need to read the output of that command. e.g.

sh "whoami"

But sh only seems to return true rather than a string containing the output of the whoami command. Does anyone know of a solution?

3 Answers
Related